Beispiel #1
0
 public static void AddEleVolate(FourTestResult AllTestResult,
                                 PhysicalVariable v1, PhysicalVariable v2, PhysicalVariable v3, PhysicalVariable v4,
                                 int h1, int h2, int h3, int h4)
 {
     if (AllTestResult.PanelEnable)
     {
         AllTestResult.Panel1EleYAndVolate.EleVolate = v1;
         AllTestResult.Panel1EleYAndVolate.HodeTime  = h1;
     }
     if (AllTestResult.Pane2Enable)
     {
         AllTestResult.Panel2EleYAndVolate.EleVolate = v2;
         AllTestResult.Panel2EleYAndVolate.HodeTime  = h2;
     }
     if (AllTestResult.Pane3Enable)
     {
         AllTestResult.Panel3EleYAndVolate.EleVolate = v3;
         AllTestResult.Panel3EleYAndVolate.HodeTime  = h3;
     }
     if (AllTestResult.Pane4Enable)
     {
         AllTestResult.Panel4EleYAndVolate.EleVolate = v4;
         AllTestResult.Panel4EleYAndVolate.HodeTime  = h4;
     }
 }
Beispiel #2
0
 public static void AddEleY(FourTestResult AllTestResult,
                            PhysicalVariable eley1, PhysicalVariable eley2, PhysicalVariable eley3, PhysicalVariable eley4)
 {
     if (AllTestResult.PanelEnable)
     {
         AllTestResult.Panel1EleYAndVolate.EleY = eley1;
     }
     if (AllTestResult.Pane2Enable)
     {
         AllTestResult.Panel2EleYAndVolate.EleY = eley2;
     }
     if (AllTestResult.Pane3Enable)
     {
         AllTestResult.Panel3EleYAndVolate.EleY = eley3;
     }
     if (AllTestResult.Pane4Enable)
     {
         AllTestResult.Panel4EleYAndVolate.EleY = eley4;
     }
 }
Beispiel #3
0
        public static byte[] Getbytesdata(FourTestResult fs, Int16 ImageID)
        {
            List <byte> rel = new List <byte>();

            rel.AddRange(new byte[] { 0xdd, 0x0a, (byte)fs.NeedTestNum });
            if (fs.PanelEnable)
            {
                foreach (var a in fs.Panel1Result)
                {
                    PhysicalVariable cn   = a.Cn;
                    PhysicalVariable cnt  = a.CnTan;
                    byte[]           cnf  = BitConverter.GetBytes((float)cn.value);
                    byte[]           cntf = BitConverter.GetBytes((float)cnt.value);
                    rel.AddRange(cnf);
                    rel.AddRange(cntf);
                }
                if (Models.AutoStateStatic.SState.Quality)
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel1EleYAndVolate.EleY.value));
                    rel.Add(0x01);
                    rel.Add(0x01
                            );
                }
                else
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel1EleYAndVolate.EleY.value));
                    rel.Add(0x00);
                    rel.Add(0x01);
                }
                rel.AddRange(BitConverter.GetBytes((float)fs.Panel1EleYAndVolate.EleVolate.value));
                rel.Add((byte)fs.Panel1EleYAndVolate.HodeTime);
                rel.Add(0x02);
            }
            if (fs.Pane2Enable)
            {
                foreach (var a in fs.Panel2Result)
                {
                    PhysicalVariable cn   = a.Cn;
                    PhysicalVariable cnt  = a.CnTan;
                    byte[]           cnf  = BitConverter.GetBytes((float)cn.value);
                    byte[]           cntf = BitConverter.GetBytes((float)cnt.value);
                    rel.AddRange(cnf);
                    rel.AddRange(cntf);
                }
                if (Models.AutoStateStatic.SState.Quality)
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel2EleYAndVolate.EleY.value));
                    rel.Add(0x01);
                    rel.Add(0x01);
                }
                else
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel2EleYAndVolate.EleY.value));
                    rel.Add(0x00);
                    rel.Add(0x01);
                }
                rel.AddRange(BitConverter.GetBytes((float)fs.Panel2EleYAndVolate.EleVolate.value));
                rel.Add((byte)fs.Panel2EleYAndVolate.HodeTime);
                rel.Add(0x02);
            }
            if (fs.Pane3Enable)
            {
                foreach (var a in fs.Panel3Result)
                {
                    PhysicalVariable cn   = a.Cn;
                    PhysicalVariable cnt  = a.CnTan;
                    byte[]           cnf  = BitConverter.GetBytes((float)cn.value);
                    byte[]           cntf = BitConverter.GetBytes((float)cnt.value);
                    rel.AddRange(cnf);
                    rel.AddRange(cntf);
                }
                if (Models.AutoStateStatic.SState.Quality)
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel3EleYAndVolate.EleY.value));
                    rel.Add(0x01);
                    rel.Add(0x01);
                }
                else
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel3EleYAndVolate.EleY.value));
                    rel.Add(0x00);
                    rel.Add(0x01);
                }
                rel.AddRange(BitConverter.GetBytes((float)fs.Panel3EleYAndVolate.EleVolate.value));
                rel.Add((byte)fs.Panel3EleYAndVolate.HodeTime);
                rel.Add(0x02);
            }
            if (fs.Pane4Enable)
            {
                foreach (var a in fs.Panel4Result)
                {
                    PhysicalVariable cn   = a.Cn;
                    PhysicalVariable cnt  = a.CnTan;
                    byte[]           cnf  = BitConverter.GetBytes((float)cn.value);
                    byte[]           cntf = BitConverter.GetBytes((float)cnt.value);
                    rel.AddRange(cnf);
                    rel.AddRange(cntf);
                }
                if (Models.AutoStateStatic.SState.Quality)
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel4EleYAndVolate.EleY.value));
                    rel.Add(0x01);
                    rel.Add(0x01);
                }
                else
                {
                    rel.AddRange(BitConverter.GetBytes((float)fs.Panel4EleYAndVolate.EleY.value));
                    rel.Add(0x00);
                    rel.Add(0x01);
                }
                rel.AddRange(BitConverter.GetBytes((float)fs.Panel4EleYAndVolate.EleVolate.value));
                rel.Add((byte)fs.Panel4EleYAndVolate.HodeTime);
                rel.Add(0x02);
            }
            return(rel.ToArray());
        }
Beispiel #4
0
 public static FourTestResult ReturntestTestData(FourTestResult AllTestResult, string Cn1, string Cn2, string Cn3, string Cn4,
                                                 string Ag1, string Ag2, string Ag3, string Ag4, bool ISVOLATEFALSE)
 {
     if (ISVOLATEFALSE)
     {
         if (AllTestResult.PanelEnable)
         {
             PanelResult p1 = new PanelResult
             {
                 Cn    = NumericsConverter.Text2Value(Cn1),
                 CnTan = NumericsConverter.Text2Value(Ag1)
             };
             AllTestResult.Panel1Result.Add(p1);
         }
         if (AllTestResult.Pane2Enable)
         {
             PanelResult p2 = new PanelResult
             {
                 Cn    = NumericsConverter.Text2Value(Cn2),
                 CnTan = NumericsConverter.Text2Value(Ag2)
             };
             AllTestResult.Panel2Result.Add(p2);
         }
         if (AllTestResult.Pane3Enable)
         {
             PanelResult p3 = new PanelResult
             {
                 Cn    = NumericsConverter.Text2Value(Cn3),
                 CnTan = NumericsConverter.Text2Value(Ag3)
             };
             AllTestResult.Panel3Result.Add(p3);
         }
         if (AllTestResult.Pane4Enable)
         {
             PanelResult p4 = new PanelResult
             {
                 Cn    = NumericsConverter.Text2Value(Cn4),
                 CnTan = NumericsConverter.Text2Value(Ag4)
             };
             AllTestResult.Panel4Result.Add(p4);
         }
         return(AllTestResult);
     }
     else
     {
         if (AllTestResult.PanelEnable)
         {
             PanelResult p1 = new PanelResult
             {
                 Cn    = NumericsConverter.Text2Value("0pF"),
                 CnTan = NumericsConverter.Text2Value("0")
             };
             AllTestResult.Panel1Result.Add(p1);
         }
         if (AllTestResult.Pane2Enable)
         {
             PanelResult p2 = new PanelResult
             {
                 Cn    = NumericsConverter.Text2Value("0pF"),
                 CnTan = NumericsConverter.Text2Value("0")
             };
             AllTestResult.Panel2Result.Add(p2);
         }
         if (AllTestResult.Pane3Enable)
         {
             PanelResult p3 = new PanelResult();
             p3.Cn = NumericsConverter.Text2Value("0pF"); p3.CnTan = NumericsConverter.Text2Value("0");
             AllTestResult.Panel3Result.Add(p3);
         }
         if (AllTestResult.Pane4Enable)
         {
             PanelResult p4 = new PanelResult();
             p4.Cn = NumericsConverter.Text2Value("0pF"); p4.CnTan = NumericsConverter.Text2Value("0");
             AllTestResult.Panel4Result.Add(p4);
         }
         return(AllTestResult);
     }
 }