Beispiel #1
0
        private void dome()//完  成
        {
            if (svstatus.Text == "Status:successful")
            {
                timer1.Enabled = false;
                panel2.Visible = false;
                pageset();
                PB.Maximum = 100; PB.Value = 100;
                Perlabel.Text = "100%";
                sendmessage($"Completed#{StationLab.Text}#{tempgvid}#{Perlabel.Text}");
                label2.Text = "Model";
                button4.Visible = false;
                string StrSql = $"exec sp_UpdateStationStatus '{StationLab.Text}'";
                if (AdoInterface.InsertData(StrSql) == 0)
                {
                    MessageBox.Show("数据库连接失败,无法更新状态!");
                }
                label5.Text = "00:00"; label7.Text = "00:00";
            }
            else
            {
                MessageBox.Show("服务端连接失败,请重试!");
                Tryconnect();
            }


        }
Beispiel #2
0
        private void Form1_Load(object sender, EventArgs e)
        {
            UpdateClass.UpdateFrom("FCT-LED-Client");
            this.Text = this.Text + "-" + Application.ProductVersion;
            label8.Text = "REV." + Application.ProductVersion;
            Station();
            InitSocket();
            modellist();
            string Strsql = $"exec sp_Busy '{StationLab.Text}'";
            string statusID = AdoInterface.Readstr(Strsql);
            if (statusID == "0")
            {
                pageset();
            }
            else if (statusID == "1")
            {
                loadtempmodel();
                button2_Click(sender, e);
                loadtime();
            }
            cl = true;


            MouseMove += Form_MouseMove;
            MouseDown += Form_MouseDown;
        }
Beispiel #3
0
        private void GridView_CellContentClick(object sender, DataGridViewCellEventArgs e)//gridview点击事件
        {
            if (GridView.RowCount > 0)
            {
                if (e.ColumnIndex == 3)
                {
                    if (svstatus.Text == "Status:successful")
                    {
                        if (bl)
                        {
                            string StrSql = null;
                            if (GridView.CurrentRow.Cells["EntBut"].Value.ToString() != "完  成")
                            {
                                for (int i = 0; i < GridView.RowCount; i++)
                                {
                                    if (GridView.Rows[i].Cells["EntBut"].Value.ToString() == "进行中...")
                                    {
                                        GridView.Rows[i].Cells["EntBut"].Value = "完  成";
                                        
                                        GridView.Rows[i].Cells["bs"].Value = imageList1.Images[1];
                                        StrSql =$"{StrSql} exec sp_UpdateTempStepStatus '{int.Parse(GridView.Rows[i].Cells["ID"].Value.ToString())}','完  成','{StationLab.Text.Trim()}';"; 
                                                                               
                                    }
                                }

                                GridView.CurrentRow.Cells["EntBut"].Value = "进行中...";
                                GridView.CurrentRow.Cells["bs"].Value = imageList1.Images[0];
                                tempgvid = GridView.CurrentRow.Cells["ID"].Value.ToString();
                                timecalibration();
                                string str = $"Operational#{StationLab.Text}#{GridView.CurrentRow.Cells["ID"].Value.ToString()}#{Perlabel.Text}";
                                sendmessage(str);
                                gmeg = str;
                                StrSql = $"{StrSql} exec sp_UpdateTempStepStatus '{int.Parse(tempgvid)}','进行中...','{StationLab.Text.Trim()}';";
                               
                                if (AdoInterface.InsertData(StrSql) == 0)
                                {
                                    MessageBox.Show("数据库连接失败,无法更新状态!");
                                }
                                
                                sicconfig(int.Parse(GridView.CurrentRow.Cells["ID"].Value.ToString()));
                            }
                            else
                            {
                                MessageBox.Show("已经完成不可以再点");
                            }
                        }
                        else
                        {
                            MessageBox.Show("有异常信息在进行中");
                           
                        }
                    }
                    else
                    {
                        Tryconnect();
                    }
                }
            }
        }
Beispiel #4
0
 }//窗体移动
 private void loadtempmodel()//加载临时Model
 {
     string StrSql = $"exec sp_TempModel '{StationLab .Text}'";
     string str = AdoInterface.Readstr(StrSql);
     if (str != null)
     {
          label2.Text =str;                         
     }
 }
Beispiel #5
0
 private void Station()//查询当前电脑绑定的Station
 {
     string Strsql = $"exec sp_Station_Find '{Dns.GetHostName()}'";
     string str = AdoInterface.Readstr(Strsql);
     if (str != null)
     {
         StationLab.Text = str;
     }
 }
Beispiel #6
0
        private void StationSetting_Load(object sender, EventArgs e)
        {
            string  strsql = "exec sp_StationList";
            DataSet ds     = new DataSet();

            ds = AdoInterface.GetDataSet(strsql);
            StationSetCombo.DataSource    = ds.Tables[0];
            StationSetCombo.DisplayMember = "Station";
        }
Beispiel #7
0
        private void FaFrm_Load(object sender, EventArgs e)
        {
            string  Strsql = "exec sp_FailList";
            DataSet ds     = new DataSet();

            ds = AdoInterface.GetDataSet(Strsql);
            comboBox1.DataSource    = ds.Tables[0];
            comboBox1.DisplayMember = "FailMessage";
            AdoInterface.FrmfailMes = "";
        }
Beispiel #8
0
 private void modellist()//加载Model comlist数据
 {
     string Strsql = $"exec sp_ModelList '{StationLab.Text}'";
     DataSet ds = new DataSet();
     ds = AdoInterface.GetDataSet(Strsql);
     if (ds != null)
     {
         Modelcombo.DataSource = ds.Tables[0];
         Modelcombo.DisplayMember = "Model";                              
     }
 }
Beispiel #9
0
        private void ModelSave_Click(object sender, EventArgs e)
        {
            string StrSql = $"sp_UpdateStation '{StationSetCombo.Text }','{Dns.GetHostName()}'";

            if (AdoInterface.InsertData(StrSql) == 1)
            {
                MessageBox.Show("Station绑定成功,请重新启动程序!");
                Close();
                Dispose();
                Application.Exit();
            }

            //    Properties.Settings.Default.Station = StationSetCombo.Text;
            //    Properties.Settings.Default.Save();
            //    Close();
        }
Beispiel #10
0
 private void rockontime()//进度条计时
 {
     string StrSql = $"exec sp_QueryH '{label2.Text}'";
     string str = AdoInterface.Readstr(StrSql);
     if (str != null)
     {
         int t = int.Parse(str);              
         TimeSpan ts = new TimeSpan(0, t, 0);
         label7.Text = ts.Hours.ToString("00") + ":" + ts.Minutes.ToString("00");              
         PB.Maximum = t;
         PB.Value = t;
         num = 8;
         time1click();
         timer1.Interval = 60000;
         timer1.Start();
     }
 }
Beispiel #11
0
 private void sicconfig(int id)//SIC调用接口
 {
     string strsql = $"exec sp_sicconfigquery '{id}'";
     DataSet ds = new DataSet();
     ds = AdoInterface.GetDataSet(strsql);
     if (ds.Tables[0].Rows.Count >0)
     {
         INIHelper.Path = $"{Application.StartupPath.ToString()}\\ESIC_Client\\SICSetting.ini";
         INIHelper.Write("setting", "Project", ds.Tables[0].Rows[0]["Project"].ToString());
         INIHelper.Write("setting", "Category", ds.Tables[0].Rows[0]["Category"].ToString());
         INIHelper.Write("setting", "Model", ds.Tables[0].Rows[0]["Model"].ToString());
         INIHelper.Write("setting", "Side", ds.Tables[0].Rows[0]["Side"].ToString());
         INIHelper.Write("setting", "Station", ds.Tables[0].Rows[0]["Station"].ToString());
         FileStream fs = new FileStream($"{Application.StartupPath.ToString()}\\ESIC_Client\\SICStart.txt", FileMode.OpenOrCreate, FileAccess.ReadWrite);
         fs.Dispose();
         fs.Close();
     }          
 }
Beispiel #12
0
        private void loadtime()//加载剩余时间
        {
            string StrSql = $"exec sp_LoadTime '{StationLab.Text}'";
            string str = AdoInterface.Readstr(StrSql);
            if (str != null)
            {
                int t = int.Parse(str);
                if (t<PB.Value)
                {
                    PB.Value = PB.Value - t;
                }
                else
                {
                    Thread th = new Thread(loaddome);
                    th.Start();                                       
                }

            }
        }
Beispiel #13
0
 private void timer3_Tick(object sender, EventArgs e)//异常计时
 {
     if (label3.Text != "")
     {
         yctime++;
         button3.Text = $"异 常  {yctime}";
     }
     else
     {
         timer3.Enabled = false;
        
         button3.Text = "异 常";
         string StrSql = $"exec sp_UpdateWaitingTime '{yctime}','{StationLab.Text}'";
         if (AdoInterface.InsertData(StrSql) == 0)
         {
             MessageBox.Show("数据库连接失败,无法更新状态!");
         }
         yctime = 0;
     }
 }
Beispiel #14
0
 private void button2_Click(object sender, EventArgs e)
 {
     panel2.Width = 600;
     panel2.Height = 430;
     panel2.Top = 100;
     panel2.Left = 15;
     panel1.Visible = false;
     panel2.Visible = true;           
     button4.Visible = true;
     if (label2.Text == "Model")
     {
         label2.Text = Modelcombo.Text;
     }          
     string StrSql = $"exec sp_AssyStep '{label2.Text}','{StationLab.Text}'";
     DataSet ds = new DataSet();
     ds = AdoInterface.GetDataSet(StrSql);
     GridView.DataSource = ds.Tables[0];
     for (int i = 0; i < GridView.Rows.Count ; i++)
     {
         if (GridView.Rows[i].Cells["EntBut"].Value.ToString() == "进行中...")
         {
             tempgvid = GridView.Rows[i].Cells["ID"].Value.ToString();
         }
         switch (GridView.Rows[i].Cells["EntBut"].Value.ToString())
         {
             case "进行中...":
                 GridView.Rows[i].Cells["bs"].Value = imageList1.Images[0];
                
                 break;
             case "完  成":
                 GridView.Rows[i].Cells["bs"].Value = imageList1.Images[1];
                 break;
         }
     }
     rockontime();
     timecalibration();
 }