Пример #1
0
        public ReportFrm()
        {
            InitializeComponent();
            DataTable mydt = DataBaseTools.Query(mySql());

            dataTableToListview(listView1, mydt);
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            string    sql  = "SELECT DISTINCT trayIndex FROM REP_FRAME ";
            DataTable mydt = DataBaseTools.Query(sql);

            dataTableToListview(listView1, mydt);
        }
Пример #3
0
        private void init()   //初始化产品排列信息
        {
            myFInfo.ImageXNum = 3;
            myFInfo.ImageYNum = 2;
            myFInfo.FrameXNum = 6;
            myFInfo.FrameYNum = 42;

            string    sql  = "SELECT DISTINCT trayIndex FROM REP_FRAME WHERE lotGUID='" + myGuid + "'";
            DataTable mydt = DataBaseTools.Query(sql);

            int length = mydt.Rows.Count;

            for (int i = 0; i < length; i++)
            {
                comboBox1.Items.Add(mydt.Rows[i][0].ToString());
            }
            comboBox1.SelectedIndex = 0;

            string    sql2  = "SELECT lotNo FROM REP_INST WHERE lotGUID = '" + myGuid + "'";
            DataTable mydt2 = DataBaseTools.Query(sql2);

            lb_LOT.Text = "LOT: " + mydt2.Rows[0][0].ToString();

            string    sql3  = "SELECT operatorID FROM REP_INST WHERE lotGUID = '" + myGuid + "'";
            DataTable mydt3 = DataBaseTools.Query(sql3);

            lb_Operator.Text = "Operator: " + mydt3.Rows[0][0].ToString();
        }
Пример #4
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            mTable.Clear();



            string    trayIndex = comboBox1.SelectedItem.ToString();
            string    sql       = "SELECT frameIndex,unitContent from REP_FRAME WHERE lotGUID='" + myGuid + "' AND trayIndex='" + trayIndex + "'";
            DataTable mydt      = DataBaseTools.Query(sql);
            //textBox1.Text = mydt.Rows.Count.ToString() + "," + mydt.Rows[3][0].ToString();
            int length = mydt.Rows.Count;

            for (int i = 0; i < length * (myFInfo.FrameXNum + 1); i++)
            {
                mTable.Rows.Add("");
            }

            for (int i = 0; i < length; i++)
            {
                int    startP = i * (myFInfo.FrameXNum + 1);
                string ss     = mydt.Rows[i][0].ToString();

                mTable.Rows[startP][0] = "Frame" + ss;

                string ss2 = mydt.Rows[i][1].ToString();

                int[] tempI = Array.ConvertAll(ss2.TrimEnd(',').Split(','), int.Parse);

                for (int j = 0; j < tempI.Length; j++)
                {
                    Point p = GetPosition((j + 1), myFInfo);

                    mTable.Rows[p.X - 1 + startP][p.Y] = tempI[j];
                }
            }
        }
Пример #5
0
        /// <summary>
        /// 一个lot跑完了 记录数据啥的
        /// </summary>
        private void EndLot()
        {
            videofrm.listBoxShowMessage("Lot完成");


            //写Lot Summary
            Tools.WriteLotSummary();
            videofrm.listBoxShowMessage("已写入Lot Summary");

            Global.mMState = MachineState.Free; //工作停止

            Global.ready2Go = false;            //开始按钮不再有用

            Global.endTime = DateTime.Now;
            //弹出个对话框 显示一些信息

            using (EndLotFrm endLotFrm = new EndLotFrm())
            {
                if (endLotFrm.ShowDialog() == DialogResult.OK)
                {
                    //啥都不干
                }
            }

            //记录时间
            Global.endLotTime = DateTime.Now;

            //下面的100代表产品数量,99pass数量 1fail数等  需要修正
            string s1 = Global.TotalFrame + "," + 100 + "," + "99" + "," + 1 + "," + 0 + "," + "1" + "," + 99;

            Global.attrib = s1;

            //这边记录下frame里排列组合啥样,需要显示根据这个来
            string s2 = Global.ImageXNum + "," + Global.ImageYNum + "," + Global.FrameXNum + "," + Global.FrameYNum;

            Global.runAttrib = s2;

            //保存INST数据
            Model_INST model1 = new Model_INST();

            model1.lotGUID    = Global.lotGUID;
            model1.lotNo      = Global.LotNum;
            model1.startTime  = Global.startTime;
            model1.endTime    = Global.endTime;
            model1.endLotTime = Global.endLotTime;
            model1.operatorID = Global.OperatorID;
            model1.attrib     = Global.attrib;
            model1.runAttrib  = Global.runAttrib;
            model1.reportType = Global.reportType;
            DataBaseTools.InsertModel_INST(model1);


            Global.frameIndex = 0;
            //保存frame数据
            foreach (var resultList in Global.AllFrameReslut)
            {
                Global.frameIndex++;
                Global.trayIndex = Global.frameIndex;  //反正就是一个list一个index
                foreach (var result in resultList)
                {
                    StringBuilder ss = new StringBuilder();
                    foreach (var t in result)
                    {
                        ss.Append(t + ",");
                    }
                    string      frameResult = ss.ToString();
                    Model_FRAME model2      = new Model_FRAME();
                    model2.lotGUID     = Global.lotGUID;
                    model2.trayIndex   = Global.trayIndex;
                    model2.frameIndex  = Global.frameIndex;
                    model2.unitContent = frameResult;
                    DataBaseTools.InsertModel_FRAME(model2);
                }
            }

            videofrm.listBoxShowMessage("数据已写入数据库");
        }
Пример #6
0
        private void bt_Query_Click(object sender, EventArgs e)
        {
            DataTable mydt = DataBaseTools.Query(mySql());

            dataTableToListview(listView1, mydt);
        }