示例#1
0
        public void DifferentTestIDsDisplayDifferentStrings()
        {
            TestID testID1 = new TestID();
            TestID testID2 = new TestID();

            Assert.AreNotEqual(testID1.ToString(), testID2.ToString());
        }
		public void ClonedTestIDsAreEqual()
		{
			TestID testID = new TestID();
			TestID cloneID = (TestID)testID.Clone();
			Assert.AreEqual( testID, cloneID );

			Assert.IsTrue( testID == cloneID, "operator ==" );
			Assert.IsFalse( testID != cloneID, "operator !=" );
		}
		public void DifferentTestIDsAreNotEqual()
		{
			TestID testID1 = new TestID();
			TestID testID2 = new TestID();
			Assert.AreNotEqual( testID1, testID2 );

			Assert.IsFalse( testID1 == testID2, "operator ==" );
			Assert.IsTrue( testID1 != testID2, "operator !=" );
		}
示例#4
0
        public void DifferentTestIDsAreNotEqual()
        {
            TestID testID1 = new TestID();
            TestID testID2 = new TestID();

            Assert.AreNotEqual(testID1, testID2);

            Assert.IsFalse(testID1 == testID2, "operator ==");
            Assert.IsTrue(testID1 != testID2, "operator !=");
        }
示例#5
0
        public void ClonedTestIDsAreEqual()
        {
            TestID testID  = new TestID();
            TestID cloneID = (TestID)testID.Clone();

            Assert.AreEqual(testID, cloneID);

            Assert.IsTrue(testID == cloneID, "operator ==");
            Assert.IsFalse(testID != cloneID, "operator !=");
        }
示例#6
0
 private string[] GetDependencies()
 {
     if (TestID != null)
     {
         return(TestID.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries));
     }
     else
     {
         return new string[] { }
     };
 }
示例#7
0
 public bool ExistTestItem(TestID testID)
 {
     if (_testItems.ContainsKey(testID))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
示例#8
0
 public bool AddTestItem(TestID testID, IItemInfo itemInfo)
 {
     //if (_testItems.ContainsKey(testID))
     //    return false;
     //else {
     _testItems.Add(testID, itemInfo);
     _itemIndexes.Add(testID, _testItems.Count - 1);
     //_ItemFilter.Add(true);
     //}
     return(true);
 }
示例#9
0
        public IItemInfo GetItemInfo(TestID testID)
        {
            IItemInfo info;

            if (_testItems.TryGetValue(testID, out info))
            {
                return(info);
            }
            else
            {
                return(null);
            }
        }
示例#10
0
        public int GetIndex(TestID testID)
        {
            int index;

            if (_itemIndexes.TryGetValue(testID, out index))
            {
                return(index);
            }
            else
            {
                throw new Exception("Do Check the testID if exist first!");
            }
        }
示例#11
0
        private void GetTestsForListView()
        {
            TestID.Clear();
            MethodSelect.Items.Clear();
            ActiveSelect.IsChecked = false;

            message = new Message();
            message.Add(IDTest);
            request  = JsonConvert.SerializeObject(message);
            response = server.SendMsg("UpdateTestChange", Data.ServiceSel, request);
            resMes   = JsonConvert.DeserializeObject <Message>(response);

            message = new Message();
            message.Add("", "", "");
            request  = JsonConvert.SerializeObject(message);
            response = server.SendMsg("GetKPInfo", Data.ServiceSel, request);
            Message resMes2 = JsonConvert.DeserializeObject <Message>(response);

            message = new Message();
            message.Add("", "", IDTest);
            request  = JsonConvert.SerializeObject(message);
            response = server.SendMsg("GetKPInfo", Data.ServiceSel, request);
            Message resMes3 = JsonConvert.DeserializeObject <Message>(response);

            if (resMes.args[0].Equals("error"))
            {
                MessageBox.Show("Ошибка! Обратитесь к поддержке");
            }
            else
            {
                //MethodSelect.Items.Add("- [-]");
                //resMes2.args.RemoveAt(3);
                for (int i = 0; i < resMes2.args.Count; i += 4)
                {
                    if (!resMes2.args[i].Equals("-"))
                    {
                        MethodSelect.Items.Add(resMes2.args[i] + " [" + resMes2.args[i + 3] + "]");
                    }
                }
                if (!resMes3.args[0].Equals("error"))
                {
                    MethodSelect.Text = resMes3.args[0] + " [" + resMes3.args[3] + "]".ToString();
                }
                TestID.Text            = IDTest;
                ActiveSelect.IsChecked = Convert.ToBoolean(resMes.args[2].ToString());
            }
            message = new Message();
        }
示例#12
0
		public void DifferentTestIDsDisplayDifferentStrings()
		{
			TestID testID1 = new TestID();
			TestID testID2 = new TestID();
			Assert.AreNotEqual( testID1.ToString(), testID2.ToString() );
		}
示例#13
0
            public bool ShowUseMethod()
            {
                TestID model = new TestID();

                TestID[] models = new TestID[] { };
                int      id     = 0;

                string where = string.Empty;
                KeyObject[] kos = new KeyObject[] { };
                int         top = 0;

                KeyBoolean[] kbs    = new KeyBoolean[] { };
                int          pcount = 0;
                int          pindex = 0;
                int          psum   = 0;
                DataSet      ds     = null;
                DataRow      dr     = null;
                string       sort   = string.Empty;

                string[] sqls = new string[] { };

                // BLL
                YTS.BLL.MSSQLServer_IntID <TestID, YTS.DAL.MSSQLServer_IntID <TestID> > bll = new YTS.BLL.MSSQLServer_IntID <TestID, YTS.DAL.MSSQLServer_IntID <TestID> >();
                bll.Insert(model);
                bll.Insert(models);
                bll.Delete(where);
                bll.Update(kos, where);
                bll.Select(top, where, kbs);
                bll.Select(pcount, pindex, out psum, where, kbs);
                bll.GetRecordCount(where);
                bll.GetModel(where, kbs);
                bll.GetTableName();
                bll.QueryRecords(top, where, sort);
                bll.QueryRecords(pcount, pindex, out psum, where, sort);
                bll.DataRowToModel(dr);
                bll.DataSetToModels(ds);
                bll.IDInsert(model, out id);
                bll.IDDelete(id);
                bll.IDUpdate(kos, id);
                bll.IDGetModel(id);

                BLL_MSSQLServer <TestID, YTS.DAL.MSSQLServer_IntID <TestID> > ms_bll = bll;

                ms_bll.Insert(model);
                ms_bll.Insert(models);
                ms_bll.Delete(where);
                ms_bll.Update(kos, where);
                ms_bll.Select(top, where, kbs);
                ms_bll.Select(pcount, pindex, out psum, where, kbs);
                ms_bll.GetRecordCount(where);
                ms_bll.GetModel(where, kbs);
                ms_bll.GetTableName();
                ms_bll.QueryRecords(top, where, sort);
                ms_bll.QueryRecords(pcount, pindex, out psum, where, sort);
                ms_bll.DataRowToModel(dr);
                ms_bll.DataSetToModels(ds);

                AbsBLL <TestID, YTS.DAL.MSSQLServer_IntID <TestID>, string, ColumnModelParser <TestID>, ColumnInfo> abs_bll = ms_bll;

                abs_bll.Insert(model);
                abs_bll.Insert(models);
                abs_bll.Delete(where);
                abs_bll.Update(kos, where);
                abs_bll.Select(top, where, kbs);
                abs_bll.Select(pcount, pindex, out psum, where, kbs);
                abs_bll.GetRecordCount(where);
                abs_bll.GetModel(where, kbs);

                AbsBLL_OnlyQuery <TestID, YTS.DAL.MSSQLServer_IntID <TestID>, string, ColumnModelParser <TestID>, ColumnInfo> abs_bll_onlquery = abs_bll;

                abs_bll_onlquery.Select(top, where, kbs);
                abs_bll_onlquery.Select(pcount, pindex, out psum, where, kbs);
                abs_bll_onlquery.GetRecordCount(where);
                abs_bll_onlquery.GetModel(where, kbs);

                IBLL <TestID, YTS.DAL.MSSQLServer_IntID <TestID>, string, ColumnModelParser <TestID>, ColumnInfo> i_bll = ms_bll;

                i_bll.Insert(model);
                i_bll.Insert(models);
                i_bll.Delete(where);
                i_bll.Update(kos, where);
                i_bll.Select(top, where, kbs);
                i_bll.Select(pcount, pindex, out psum, where, kbs);
                i_bll.GetRecordCount(where);
                i_bll.GetModel(where, kbs);

                IBLL_OnlyQuery <TestID, YTS.DAL.MSSQLServer_IntID <TestID>, string, ColumnModelParser <TestID>, ColumnInfo> i_bll_onlyquery = abs_bll_onlquery;

                i_bll_onlyquery.Select(top, where, kbs);
                i_bll_onlyquery.Select(pcount, pindex, out psum, where, kbs);
                i_bll_onlyquery.GetRecordCount(where);
                i_bll_onlyquery.GetModel(where, kbs);


                // DAL
                YTS.DAL.MSSQLServer_IntID <TestID> dal = bll.SelfDAL;
                dal.Insert(model);
                dal.Insert(models);
                dal.Delete(where);
                dal.Update(kos, where);
                dal.Select(top, where, kbs);
                dal.Select(pcount, pindex, out psum, where, kbs);
                dal.GetRecordCount(where);
                dal.GetModel(where, kbs);
                dal.GetTableName();
                dal.QueryRecords(top, where, sort);
                dal.QueryRecords(pcount, pindex, out psum, where, sort);
                dal.DataRowToModel(dr);
                dal.DataSetToModels(ds);
                dal.IsNeedSupplementary();
                dal.ExecutionSupplementary();
                dal.IDInsert(model, out id);
                dal.IDDelete(id);
                dal.IDUpdate(kos, id);
                dal.IDGetModel(id);
                dal.Transaction(sqls);

                DAL_MSSQLServer <TestID> ms_dal = dal;

                ms_dal.Insert(model);
                ms_dal.Insert(models);
                ms_dal.Delete(where);
                ms_dal.Update(kos, where);
                ms_dal.Select(top, where, kbs);
                ms_dal.Select(pcount, pindex, out psum, where, kbs);
                ms_dal.GetRecordCount(where);
                ms_dal.GetModel(where, kbs);
                ms_dal.GetTableName();
                ms_dal.QueryRecords(top, where, sort);
                ms_dal.QueryRecords(pcount, pindex, out psum, where, sort);
                ms_dal.DataRowToModel(dr);
                ms_dal.DataSetToModels(ds);
                ms_dal.IsNeedSupplementary();
                ms_dal.ExecutionSupplementary();
                ms_dal.Transaction(sqls);

                AbsDAL <TestID, string, ColumnModelParser <TestID>, ColumnInfo> abs_dal = ms_dal;

                abs_dal.Insert(model);
                abs_dal.Insert(models);
                abs_dal.Delete(where);
                abs_dal.Update(kos, where);
                abs_dal.Select(top, where, kbs);
                abs_dal.Select(pcount, pindex, out psum, where, kbs);
                abs_dal.GetRecordCount(where);
                abs_dal.GetModel(where, kbs);

                AbsDAL_OnlyQuery <TestID, string, ColumnModelParser <TestID>, ColumnInfo> abs_dal_onlyquery = abs_dal;

                abs_dal_onlyquery.Select(top, where, kbs);
                abs_dal_onlyquery.Select(pcount, pindex, out psum, where, kbs);
                abs_dal_onlyquery.GetRecordCount(where);
                abs_dal_onlyquery.GetModel(where, kbs);

                IDAL <TestID, string, ColumnModelParser <TestID>, ColumnInfo> i_dal = abs_dal;

                i_dal.Insert(model);
                i_dal.Insert(models);
                i_dal.Delete(where);
                i_dal.Update(kos, where);
                i_dal.Select(top, where, kbs);
                i_dal.Select(pcount, pindex, out psum, where, kbs);
                i_dal.GetRecordCount(where);
                i_dal.GetModel(where, kbs);

                IDAL_OnlyQuery <TestID, string, ColumnModelParser <TestID>, ColumnInfo> i_dal_onlyquery = i_dal;

                i_dal_onlyquery.Select(top, where, kbs);
                i_dal_onlyquery.Select(pcount, pindex, out psum, where, kbs);
                i_dal_onlyquery.GetRecordCount(where);
                i_dal_onlyquery.GetModel(where, kbs);

                return(true);
            }
示例#14
0
 public void UpdateTestText(TestID testID, string newTestText)
 {
     ((ItemInfo)_testItems[testID]).SetTestText(newTestText);
 }
示例#15
0
 public override int GetHashCode()
 {
     return(TestID.GetHashCode());
 }
示例#16
0
        public void ExtractStdf()
        {
            if (ParseDone)
            {
                return;
            }
            //private data
            bool[]   catchedPirFlag = null;
            TestID[] ptrLastTN      = null;
            int[]    InternalID     = null;

            _stdfFile = new StdfFile(FilePath);


            List <PinMapRecord>   listPinMaps   = new List <PinMapRecord>();
            List <PinGroupRecord> listPinGroups = new List <PinGroupRecord>();

            var rs = from r in _stdfFile.GetRecords()
                     select r;
            int siteIdx;

            foreach (var r in rs)
            {
                if (r.RecordType == StdfFile.PTR)
                {
                    if (!_sites.TryGetValue(((Ptr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }
                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }

                    TestID testID;
                    //compare with the previous test name to decide the testNO
                    if (ptrLastTN[siteIdx].CompareTestNumber(((Ptr)r).TestNumber))  //it's a sub test
                    {
                        testID = TestID.NewSubTestID(ptrLastTN[siteIdx]);
                        if (!_testItems.ExistTestItem(testID))
                        {
                            IItemInfo info = _testItems.GetItemInfo(ptrLastTN[siteIdx]);
                            info.SetTestText(((Ptr)r).TestText);
                            _testItems.AddTestItem(testID, info);
                            _rawData.AddItem();
                        }
                    }
                    else
                    {
                        testID = new TestID(((Ptr)r).TestNumber);
                        if (!_testItems.ExistTestItem(testID))
                        {
                            _testItems.AddTestItem(testID, new ItemInfo(((Ptr)r).TestText, ((Ptr)r).LowLimit, ((Ptr)r).HighLimit,
                                                                        ((Ptr)r).Units, ((Ptr)r).LowLimitScalingExponent, ((Ptr)r).HighLimitScalingExponent, ((Ptr)r).ResultScalingExponent));
                            _rawData.AddItem();
                        }
                    }
                    _rawData.Set(_testItems.GetIndex(testID), InternalID[siteIdx], _testItems.GetItemInfo(testID).GetScaledRst(((Ptr)r).Result));

                    ptrLastTN[siteIdx] = testID;
                }
                else if (r.RecordType == StdfFile.FTR)
                {
                    if (!_sites.TryGetValue(((Ftr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }

                    TestID testID;
                    //compare with the previous test name to decide the testNO
                    if (!ptrLastTN[siteIdx].CompareTestNumber(((Ftr)r).TestNumber))  //it's a unused test, ftr do not set sub test
                    {
                        testID = new TestID(((Ftr)r).TestNumber);

                        if (!_testItems.ExistTestItem(testID))
                        {
                            _testItems.AddTestItem(testID, new ItemInfo(((Ftr)r).TestText, (float)0.5, (float)1.5, "", 0, 0, 0));
                            _rawData.AddItem();
                        }

                        _rawData.Set(_testItems.GetIndex(testID), InternalID[siteIdx], ((Ftr)r).Results);

                        ptrLastTN[siteIdx] = testID;
                    }
                }
                else if (r.RecordType == StdfFile.MPR)
                {
                    if (!_sites.TryGetValue(((Mpr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }

                    TestID testItemID;
                    if (ptrLastTN[siteIdx].CompareTestNumber(((Mpr)r).TestNumber))  //it's a sub test
                    {
                        testItemID = TestID.NewSubTestID(ptrLastTN[siteIdx]);
                    }
                    else
                    {
                        testItemID = new TestID(((Mpr)r).TestNumber);
                    }

                    TestID testID = testItemID;

                    for (uint i = 0; i < ((Mpr)r).Results.Count(); i++)
                    {
                        PinMapRecord pin = new PinMapRecord();
                        if (siteIdx == 0 && ((Mpr)r).PinIndexes != null)
                        {
                            pin = listPinMaps.Find(x => x.PinIndex == ((Mpr)r).PinIndexes[i]);
                        }
                        //else
                        //    throw new Exception("MPR Pin doesn't exist");

                        if (i > 0)
                        {
                            testID = TestID.NewSubTestID(testID);
                        }

                        if (!_testItems.ExistTestItem(testID))
                        {
                            _testItems.AddTestItem(testID, new ItemInfo(((Mpr)r).TestText + "<>" + pin.LogicalName, ((Mpr)r).LowLimit, ((Mpr)r).HighLimit,
                                                                        ((Mpr)r).Units, ((Mpr)r).LowLimitScalingExponent, ((Mpr)r).HighLimitScalingExponent, ((Mpr)r).ResultScalingExponent));
                            _rawData.AddItem();
                        }

                        _rawData.Set(_testItems.GetIndex(testID), InternalID[siteIdx], _testItems.GetItemInfo(testID).GetScaledRst(((Mpr)r).Results[i]));
                    }

                    ptrLastTN[siteIdx] = testItemID;
                }
                else if (r.RecordType == StdfFile.MIR)
                {
                    BasicInfo = new FileBasicInfo((Mir)r);
                    continue;
                }
                else if (r.RecordType == StdfFile.SDR)
                {
                    for (int i = 0; i < ((Sdr)r).SiteNumbers.Length; i++)
                    {
                        _sites.Add(((Sdr)r).SiteNumbers[i], i);
                    }

                    catchedPirFlag = new bool[((Sdr)r).SiteNumbers.Count()];
                    InternalID     = new int[((Sdr)r).SiteNumbers.Count()];

                    ptrLastTN = new TestID[((Sdr)r).SiteNumbers.Count()];
                }
                else if (r.RecordType == StdfFile.PMR)
                {
                    listPinMaps.Add(new PinMapRecord((Pmr)r));
                }
                else if (r.RecordType == StdfFile.PGR)
                {
                    listPinGroups.Add(new PinGroupRecord((Pgr)r, listPinMaps));
                }
                else if (r.RecordType == StdfFile.PIR)
                {
                    if (!_sites.TryGetValue(((Pir)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        catchedPirFlag[siteIdx] = true;
                    }
                    else
                    {
                        throw new Exception("PIR Data Error");
                    }

                    ptrLastTN[siteIdx] = new TestID();

                    InternalID[siteIdx] = _rawData.AddChip();
                }
                else if (r.RecordType == StdfFile.BPS)
                {
                    //do nothing
                }
                else if (r.RecordType == StdfFile.EPS)
                {
                    //do nothing
                }
                else if (r.RecordType == StdfFile.PRR)
                {
                    if (!_sites.TryGetValue(((Prr)r).SiteNumber, out siteIdx))
                    {
                        throw new Exception("No Site");
                    }

                    if (!catchedPirFlag[siteIdx])
                    {
                        throw new Exception("PIR Data Error");
                    }
                    else
                    {
                        catchedPirFlag[siteIdx] = false;
                    }

                    _testChips.AddChip(new ChipInfo((Prr)r, InternalID[siteIdx]));
                }
                else if (r.RecordType == StdfFile.TSR)
                {
                    var v = ((Tsr)r).TestLabel;

                    if (v != null && v != "")
                    {
                        _testItems.UpdateTestText(new TestID(((Tsr)r).TestNumber), v);
                    }
                }
                else if (r.RecordType == StdfFile.MRR)
                {
                    ((FileBasicInfo)BasicInfo).AddMrr((Mrr)r);
                }
            }
            ParseDone = true;

            _testChips.UpdateSummary(ref _defaultSitesSummary);
            _defaultSummary = ChipSummary.Combine(_defaultSitesSummary);
            OnExtractDone(this);

            _stdfFile = null;
            rs        = null;

            GC.Collect();

            CreateDefaultFilters();
        }
示例#17
0
 public List <float?> GetFilteredItemData(TestID testID, int startIndex, int count, int filterId)
 {
     return(_rawData.GetItemDataFiltered(_testItems.GetIndex(testID), startIndex, count, _filterList[filterId].ChipFilter));
 }
示例#18
0
 /// <summary>
 /// Construct a IdFilter for a single TestID
 /// </summary>
 /// <param name="runnerID">The ID of the expected runner</param>
 /// <param name="testID">The ID of the test itself</param>
 public IdFilter(int runnerID, TestID testID)
 {
     _runnerID = runnerID;
     _testID   = testID;
 }