public bool SelectEquipment(EquipmentList aEquipList)
        {
            // string[] NameArray = EquipmentNameArray.Split(',');

            pEquipmentList = aEquipList;

            foreach (string EqupmentName in aEquipList.Keys)
            {
                if (EqupmentName.Contains("POWERSUPPLY"))
                {
                    PowersupplyName = EqupmentName;
                    PS = (Powersupply)pEquipmentList[PowersupplyName];
                }

                if (EqupmentName.Contains("THERMOCONTROLLER"))
                {
                    XstreamName = EqupmentName;
                    Xstream     = (Thermocontroller)pEquipmentList[XstreamName];
                }
                if (EqupmentName.Contains("ATTENNUATOR"))
                {
                    XAttName = EqupmentName;
                    pAtt     = (Attennuator)pEquipmentList[XAttName];
                }
            }
            return(true);
        }
Пример #2
0
        /// <summary>
        /// Web API to get all equipment
        /// </summary>
        /// <returns></returns>
        public List <SerialisedEquipment> GetAllEquipment()
        {
            EquipmentList equipmentItems      = SpartanTestSF.Core.EquipmentManager.GetAllEquipmentItems();
            List <SerialisedEquipment> retvar = equipmentItems.SerialisedEquipment;

            return(retvar);
        }
Пример #3
0
        public string generateEqRareUpgradeForPacket()
        {
            short WeaponRare    = 0;
            short WeaponUpgrade = 0;
            short ArmorRare     = 0;
            short ArmorUpgrade  = 0;

            for (short i = 0; i < 15; i++)
            {
                Inventory inv = EquipmentList.LoadBySlotAndType(i, (short)InventoryType.Equipment);
                if (inv != null)
                {
                    Item iteminfo = ServerManager.GetItem(inv.InventoryItem.ItemVNum);

                    if (iteminfo.EquipmentSlot == (short)EquipmentType.Armor)
                    {
                        ArmorRare    = inv.InventoryItem.Rare;
                        ArmorUpgrade = inv.InventoryItem.Upgrade;
                    }
                    else if (iteminfo.EquipmentSlot == (short)EquipmentType.MainWeapon)
                    {
                        WeaponRare    = inv.InventoryItem.Rare;
                        WeaponUpgrade = inv.InventoryItem.Upgrade;
                    }
                }
            }
            return(String.Format("{0}{1} {2}{3}", WeaponUpgrade, WeaponRare, ArmorUpgrade, ArmorRare));
        }
Пример #4
0
        private void button_Config_Click(object sender, EventArgs e)
        {
            button_Config.Enabled   = false;
            button_Config.BackColor = Color.Yellow;

            try
            {
                if (comboBoxPN.Text != "")
                {
                    labelShow.Text = "Equipment Config ing.......";
                    labelShow.Refresh();
                    // MyEquipmentManage = new EquipmentManage();
                    aEquipList = new EquipmentList();
                    pflowControl.ProductionTypeId   = IdProductionType;
                    pflowControl.TestPlanId         = IdTestplan;
                    pflowControl.SerialNO           = textBoxSN.Text;
                    pflowControl.ProductionTypeName = comboBoxPType.Text;

                    Thread Config = new Thread(ConfigEquipment);
                    Config.Start();


                    tabControl1.SelectedIndex = 4;
                }
                else
                {
                    MessageBox.Show("Select ProductionName");
                }
            }
            catch (Exception Me)
            {
                MessageBox.Show("ConfigEquipment Error ,PLS Check Equipment");
                FlagEquipmentConfigOK = false;
            }
        }
Пример #5
0
 protected bool PrepareEnvironment(EquipmentList aEquipList)
 {
     if (selectedEquipList["SCOPE"] != null)
     {
         Scope tempScope = (Scope)selectedEquipList["SCOPE"];
         if (tempScope.SetMaskAlignMethod(1) &&
             tempScope.SetMode(0) &&
             tempScope.MaskONOFF(false) &&
             tempScope.SetRunTilOff() &&
             tempScope.RunStop(true) &&
             tempScope.OpenOpticalChannel(true) &&
             tempScope.RunStop(true) &&
             tempScope.ClearDisplay() &&
             tempScope.AutoScale()
             )
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     else
     {
         return(false);
     }
 }
        public async Task <IActionResult> PutEquipmentList(int id, EquipmentList equipmentList)
        {
            if (id != equipmentList.EquipmentId)
            {
                return(BadRequest());
            }

            _context.Entry(equipmentList).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!EquipmentListExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #7
0
        /// <summary>
        /// Deserializes JSON into Business Objects
        /// </summary>
        /// <param name="json"></param>
        /// <returns></returns>
        private static EquipmentList DeSerializeJSON(string json)
        {
            EquipmentList retvar = new EquipmentList();

            try
            {
                retvar = JsonConvert.DeserializeObject <EquipmentList>(json);

                foreach (var equip in retvar.SerialisedEquipment)
                {
                    var equipType = retvar.EquipmentType.Where(i => i.Id == equip.EquipmentTypeId).SingleOrDefault();

                    //assign equipment type to equipment object if returned
                    if (equipType != null)
                    {
                        equip.EquipmentType = equipType;
                    }
                }
                return(retvar);
            }
            catch
            {
                return(null);
            }
        }
Пример #8
0
        public FlowControll(ConfigXmlIO MyXml, logManager alogManager)
        {
            MyLogManager      = alogManager;
            MyEquipmentManage = new EquipmentManage(alogManager);
            MyEquipList       = new EquipmentList();
            MyTestModelList   = new TestModelList();
            MyTestModelManage = new TestModelManage();
            EquipmenNameArray = new SortedList <string, string>();
            //   EquipmenNameArray = GetEquipmentNameList(TestPlanId);

            if (MyXml.DatabaseType.ToUpper() == "LOCATIONDATABASE")
            {
                MyDataio = new LocalDatabase(MyXml.DatabasePath);
            }
            else//SqlDatabase
            {
                MyXml.DatabasePath = @"INPCSZ0518\ATS_HOME";
                MyDataio           = new SqlDatabase(MyXml.DatabasePath);
            }


            dtCurrentTestModelTestData      = new DataTable();
            dtCurrentConditionResultData    = new DataTable();
            dtCurrentTestModelList          = new DataTable();
            dtCurrentTestModeParameterlList = new DataTable();
            //-----------------------------------

            TotalTestData          = new DataTable();
            DtMyConditionDataTable = new DataTable();
            DtMyTestModelParameter = new DataTable();
            DtMyDutInf             = new DataTable();
        }
Пример #9
0
 public void AddEquipment(EquipmentModel pEquipment)
 {
     if (!EquipmentList.Contains(pEquipment))
     {
         EquipmentList.Add(pEquipment);
     }
 }
Пример #10
0
 void Start()
 {
     player     = GameObject.FindGameObjectWithTag("Player").GetComponent <Player> ();
     inventory  = GameObject.FindGameObjectWithTag("Inventory").GetComponent <Inventory> ();
     equipList  = FindObjectOfType <EquipmentList>();
     slotmanger = FindObjectOfType <SlotManger>();
 }
Пример #11
0
        public override bool SelectEquipment(EquipmentList aEquipList)
        {
            selectedEquipList.Clear();
            if (aEquipList.Count == 0)
            {
                selectedEquipList.Add("DUT", dut);
                return(false);
            }
            else
            {
                bool isOK = false;
                selectedEquipList.Clear();
                IList <string>        tempKeys   = aEquipList.Keys;
                IList <EquipmentBase> tempValues = aEquipList.Values;
                for (byte i = 0; i < aEquipList.Count; i++)
                {
                    if (tempKeys[i].ToUpper().Contains("POWERSUPPLY"))
                    {
                        selectedEquipList.Add("POWERSUPPLY", tempValues[i]);
                        isOK = true;
                    }
                }
                if (selectedEquipList["POWERSUPPLY"] != null)
                {
                    isOK = true;
                }
                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                    return(isOK);
                }

                return(isOK);
            }
        }
Пример #12
0
        public Equipment CreatEquipment(User userActiv, string iD, string name, string serialNumber, string location, string statusQuall, string numberProtocol, string dateQual, int periodQual)
        {
            MessageBox.Show("Добрый вечер!");
            //if (userActiv.loginStatus)
            //{
            //MessageBox.Show("Попытка создания объекта"); Создаем объект оборудовнаие и сохраняем в Базу данных
            var equipment = new Equipment();

            equipment.ID             = CheckValue(CheckEquipmentsId, EquipmentList.ReturnEquipment(iD), "", iD, "Field ID");
            equipment.Name           = CheckValue(CheckEquipmentsName, equipment, "", name, "Field Name Equipment");
            equipment.Location       = CheckValue(CheckEquipmentsLocation, equipment, "", location, "Field Equipment Location");
            equipment.SerialNumber   = CheckValue(CheckEquipmentsSerialNumber, EquipmentList.ReturnEquipment(serialNumber), "", serialNumber, "Field Equipment Serial Number");
            equipment.Status         = CheckValue(CheckEquipmentsNumberStatusQuall, equipment, "", statusQuall, "Field Equipment Status Quall");
            equipment.NumberProtocol = CheckValue(CheckEquipmentsNumberProtocol, EquipmentList.ReturnEquipment(numberProtocol), "", numberProtocol, "Field Equipment Number Protocol");
            equipment.DateQual       = dateQual;
            equipment.PeriodQual     = periodQual;
            var date = DateTime.Parse(equipment.DateQual);

            equipment.NextDateQual = date.AddYears(periodQual).ToString();
            EquipmentList.AddDB(equipment);
            return(equipment);
            //}

            /* else
             * {
             *   Console.WriteLine("Необходим вход зарегистрирвоанного пользователя");
             *   return null;
             * }*/
            //MessageBox.Show("Вроде как и создан");
        }
Пример #13
0
        public string GenerateEquipment()
        {
            //equip 86 0 0.4903.6.8.0 2.340.0.0.0 3.4931.0.5.0 4.4845.3.5.0 5.4912.7.9.0 6.4848.1.0.0 7.4849.3.0.0 8.4850.2.0.0 9.227.0.0.0 10.281.0.0.0 11.347.0.0.0 13.4150.0.0.0 14.4076.0.0.0
            string eqlist        = String.Empty;
            short  WeaponRare    = 0;
            short  WeaponUpgrade = 0;
            short  ArmorRare     = 0;
            short  ArmorUpgrade  = 0;

            for (short i = 0; i < 15; i++)
            {
                Inventory inv = EquipmentList.LoadBySlotAndType(i, (short)InventoryType.Equipment);
                if (inv != null)
                {
                    Item iteminfo = ServerManager.GetItem(inv.InventoryItem.ItemVNum);
                    if (iteminfo.EquipmentSlot == (short)EquipmentType.Armor)
                    {
                        ArmorRare    = inv.InventoryItem.Rare;
                        ArmorUpgrade = inv.InventoryItem.Upgrade;
                    }
                    else if (iteminfo.EquipmentSlot == (short)EquipmentType.MainWeapon)
                    {
                        WeaponRare    = inv.InventoryItem.Rare;
                        WeaponUpgrade = inv.InventoryItem.Upgrade;
                    }
                    eqlist += String.Format(" {0}.{1}.{2}.{3}.{4}", i, iteminfo.VNum, inv.InventoryItem.Rare, iteminfo.Colored ? inv.InventoryItem.Color : inv.InventoryItem.Upgrade, 0);
                }
            }
            return(String.Format("equip {0}{1} {2}{3}{4}", WeaponUpgrade, WeaponRare, ArmorUpgrade, ArmorRare, eqlist));
        }
Пример #14
0
        protected bool PrepareEnvironment(EquipmentList aEquipList)
        {
            if (tempScope != null)
            {
                {
                    if (tempScope.SetMaskAlignMethod(1) &&
                        tempScope.SetMode(0) &&
                        tempScope.MaskONOFF(false) &&
                        tempScope.SetRunTilOff() &&
                        tempScope.RunStop(true) &&
                        tempScope.OpenOpticalChannel(false) &&
                        tempScope.RunStop(true) &&
                        tempScope.ClearDisplay() &&
                        tempScope.AutoScale(1)
                        )
                    {
                        Log.SaveLogToTxt("PrepareEnvironment OK!");

                        return(true);
                    }
                    else
                    {
                        Log.SaveLogToTxt("PrepareEnvironment Fail!");
                        return(false);
                    }
                }
            }
            else
            {
                return(false);
            }
        }
Пример #15
0
        public override bool SelectEquipment(EquipmentList aEquipList)
        {
            selectedEquipList.Clear();
            if (aEquipList.Count == 0)
            {
                selectedEquipList.Add("DUT", dut);
                return(false);
            }
            else
            {
                bool isOK = false;
                selectedEquipList.Clear();
                IList <string>        tempKeys   = aEquipList.Keys;
                IList <EquipmentBase> tempValues = aEquipList.Values;
                for (byte i = 0; i < aEquipList.Count; i++)
                {
                    if (tempKeys[i].ToUpper().Contains("ATTEN"))
                    {
                        selectedEquipList.Add("ATTEN", tempValues[i]);
                        isOK = true;
                    }
                    if (tempKeys[i].ToUpper().Contains("POWERSUPPLY"))
                    {
                        selectedEquipList.Add("POWERSUPPLY", tempValues[i]);
                        isOK = true;
                    }
                    if (tempKeys[i].ToUpper().Contains("NA_OPTICALSWITCH"))
                    {
                        tempValues[i].CheckEquipmentRole(2, GlobalParameters.CurrentChannel);
                    }
                }
                tempAtten = (Attennuator)selectedEquipList["ATTEN"];
                tempps    = (Powersupply)selectedEquipList["POWERSUPPLY"];
                if (tempAtten != null && tempps != null)
                {
                    isOK = true;
                }
                else
                {
                    if (tempAtten == null)
                    {
                        Log.SaveLogToTxt("ATTEN =NULL");
                    }
                    if (tempps == null)
                    {
                        Log.SaveLogToTxt("POWERSUPPLY =NULL");
                    }

                    OutPutandFlushLog();
                    isOK = false;
                }
                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                    return(isOK);
                }
                return(isOK);
            }
        }
Пример #16
0
        public override bool SelectEquipment(EquipmentList equipmentList)
        {
            selectedEquipList.Clear();

            if (equipmentList.Count == 0)
            {
                selectedEquipList.Add("DUT", dut);
                return(false);
            }
            else
            {
                bool isOK = false;

                for (byte i = 0; i < equipmentList.Count; i++)
                {
                    if (equipmentList.Keys[i].ToUpper().Contains("POWERSUPPLY"))
                    {
                        supply = (Powersupply)equipmentList.Values[i];
                        isOK   = true;
                    }

                    if (equipmentList.Keys[i].ToUpper().Contains("SCOPE"))
                    {
                        scope = (Scope)equipmentList.Values[i];
                    }

                    if (equipmentList.Keys[i].ToUpper().Contains("NA_OPTICALSWITCH"))
                    {
                        equipmentList.Values[i].CheckEquipmentRole(1, GlobalParameters.CurrentChannel);
                    }
                }

                if (supply != null && scope != null)
                {
                    isOK = true;
                }
                else
                {
                    if (supply == null)
                    {
                        Log.SaveLogToTxt("POWERSUPPLY =NULL");
                    }

                    if (scope == null)
                    {
                        Log.SaveLogToTxt("SCOPE =NULL");
                    }

                    isOK = false;
                    OutPutandFlushLog();
                }

                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                }
                return(isOK);
            }
        }
Пример #17
0
        public TEquipmentSlot AddEquipmentSlot(string name)
        {
            TEquipmentSlot newSlot = new TEquipmentSlot(name);

            newSlot.AddEquipment(0, 0, 0, "None");
            EquipmentList.Add(newSlot);
            return(newSlot);
        }
Пример #18
0
        public override void Accept(IEquipmentVisitor visitor)
        {
            // visit all sub parts
            EquipmentList.ForEach(i => i.Accept(visitor));

            // then visit current part
            visitor.Visit(this);
        }
Пример #19
0
        private void InitEquipment()
        {
            var enumarable = App.RecipeDbcontroller.GetRecipeEquipment(Recipe.RecipeID);

            foreach (Equipment e in enumarable)
            {
                EquipmentList.Add(e);
            }
        }
        public async Task <ActionResult> DeleteConfirmed(string id)
        {
            EquipmentList equipmentList = await db.equipmentLists.FindAsync(id);

            db.equipmentLists.Remove(equipmentList);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Пример #21
0
        public override bool SelectEquipment(EquipmentList aEquipList)
        {
            selectedEquipList.Clear();

            if (aEquipList.Count == 0)
            {
                selectedEquipList.Add("DUT", dut);
                return(false);
            }
            else
            {
                bool isOK = false;


                for (byte i = 0; i < aEquipList.Count; i++)
                {
                    if (aEquipList.Keys[i].ToUpper().Contains("POWERSUPPLY"))
                    {
                        pPs  = (Powersupply)aEquipList.Values[i];
                        isOK = true;
                    }
                    if (aEquipList.Keys[i].ToUpper().Contains("SCOPE"))
                    {
                        pScope = (Scope)aEquipList.Values[i];
                    }
                    if (aEquipList.Keys[i].ToUpper().Contains("NA_OPTICALSWITCH"))
                    {
                        aEquipList.Values[i].CheckEquipmentRole(1, GlobalParameters.CurrentChannel);
                    }
                }

                if (pPs != null && pScope != null)
                {
                    isOK = true;
                }
                else
                {
                    if (pPs == null)
                    {
                        logoStr += logger.AdapterLogString(3, "POWERSUPPLY =NULL");
                    }
                    if (pScope == null)
                    {
                        logoStr += logger.AdapterLogString(3, "pScope =NULL");
                    }
                    isOK = false;
                    OutPutandFlushLog();
                }
                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                }

                return(isOK);
            }
        }
Пример #22
0
        protected bool PrepareEnvironment(EquipmentList aEquipList)
        {
            if (selectedEquipList["SCOPE"] != null)
            {
                Scope tempScope = (Scope)selectedEquipList["SCOPE"];
                if (testEyeStruct.isOpticalEyeORElecEye)
                {
                    if (tempScope.SetMaskAlignMethod(1) &&
                        tempScope.SetMode(0) &&
                        tempScope.MaskONOFF(false) &&
                        tempScope.SetRunTilOff() &&
                        tempScope.RunStop(true) &&
                        tempScope.OpenOpticalChannel(true) &&
                        tempScope.RunStop(true) &&
                        tempScope.ClearDisplay() &&
                        tempScope.AutoScale()
                        )
                    {
                        logoStr += logger.AdapterLogString(1, "PrepareEnvironment OK!");
                        return(true);
                    }
                    else
                    {
                        logoStr += logger.AdapterLogString(4, "PrepareEnvironment Fail!");
                        return(false);
                    }
                }
                else
                {
                    if (tempScope.SetMaskAlignMethod(1) &&
                        tempScope.SetMode(0) &&
                        tempScope.MaskONOFF(false) &&
                        tempScope.SetRunTilOff() &&
                        tempScope.RunStop(true) &&
                        tempScope.OpenOpticalChannel(false) &&
                        tempScope.RunStop(true) &&
                        tempScope.ClearDisplay() &&
                        tempScope.AutoScale()
                        )
                    {
                        logoStr += logger.AdapterLogString(1, "PrepareEnvironment OK!");

                        return(true);
                    }
                    else
                    {
                        logoStr += logger.AdapterLogString(4, "PrepareEnvironment Fail!");
                        return(false);
                    }
                }
            }
            else
            {
                return(false);
            }
        }
Пример #23
0
        /**
         * Given an organization id, get its tabs and retrieve the complete data for each of them
         * Fire an event for each one to notify the presenter that they are ready to render
         */
        public async Task LoadTabs(int orgId)
        {
            TabList tabs = await _esdService.GetTabs(orgId);

            foreach (Tab tab in tabs.Tabs)
            {
                if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.EQUIPMENT))
                {
                    _equipmentList = await _esdService.GetOrganizationEquipment(orgId);

                    EquipmentTabLoaded?.Invoke();
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.FACILITIES))
                {
                    _facilityList = await _esdService.GetOrganizationFacilities(orgId);

                    FacilityTabLoaded?.Invoke();
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.GENERAL))
                {
                    OrganizationGeneralInfo generalInfo = await _esdService.GetOrganizationGeneralInfo(orgId);

                    GeneralTabLoaded?.Invoke(generalInfo);
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.LOCATIONS))
                {
                    _locationList = await _esdService.GetOrganizationLocations(orgId);

                    LocationTabLoaded?.Invoke();
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.PEOPLE))
                {
                    _peopleList = await _esdService.GetOrganizationPeople(orgId);

                    PeopleTabLoaded?.Invoke();
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.PHYSICIANS))
                {
                    _physicianList = await _esdService.GetOrganizationPhysicians(orgId);

                    PhysiciansTabLoaded?.Invoke();
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.TRAINING))
                {
                    _trainingList = await _esdService.GetOrganizationTrainings(orgId);

                    TrainingTabLoaded?.Invoke();
                }
                else if (tab.Name.ToUpper() == Enum.GetName(typeof(TabName), TabName.TREATMENT))
                {
                    _treatmentList = await _esdService.GetOrganizationTreatments(orgId);

                    TreatmentTabLoaded?.Invoke();
                }
            }
        }
Пример #24
0
        protected override bool ConfigureEquipment(EquipmentList selectedEquipmentList)
        {

            for (int i = 0; i < selectedEquipList.Count; i++)
            {
                if (!selectedEquipList.Values[i].Configure()) return false;
            }

            return true;
        }
Пример #25
0
        protected override bool ConfigureEquipment(EquipmentList selectedEquipmentList)
        {
            //for (int i = 0; i < selectedEquipList.Count; i++)
            //{
            //    if (!selectedEquipList.Values[i].Configure()) return false;

            //}//test

            return(true);
        }
Пример #26
0
        public override void displayPlayer(PlayerInfo _pInfo)
        {
            string output = "";

            output += new ClientInfoList(_pInfo, _options).DisplayShort(_sep);
            output += _sep;
            output += new EquipmentList(_pInfo, _options).Display(_sep);

            SendOutput(output);
        }
	public HeroData()
	{
		property = new HeroProperty ();
        equipmentList = new EquipmentList();
        realmList = new HeroRealm();
		skillList = new SkillManager();
		bufferController = new BufferController();
		battle = -1;
        level = 1;
	}
Пример #28
0
        public override bool SelectEquipment(EquipmentList aEquipList)
        {
            selectedEquipList.Clear();
            if (aEquipList.Count == 0)
            {
                selectedEquipList.Add("DUT", dut);
                return(false);
            }
            else
            {
                bool isOK = false;


                for (byte i = 0; i < aEquipList.Count; i++)
                {
                    if (aEquipList.Keys[i].ToUpper().Contains("POWERSUPPLY"))
                    {
                        pPs  = (Powersupply)aEquipList["POWERSUPPLY"];
                        isOK = true;
                    }
                    if (aEquipList.Keys[i].ToUpper().Contains("SPECTROGRAPH"))
                    {
                        pWavemeter = (Spectrograph)aEquipList["WAVEMETER"];
                    }
                    if (aEquipList.Keys[i].ToUpper().Contains("NA_OPTICALSWITCH"))
                    {
                        aEquipList.Values[i].CheckEquipmentRole(1, GlobalParameters.CurrentChannel);
                    }
                }

                if (pPs != null && pWavemeter != null)
                {
                    isOK = true;
                }
                else
                {
                    if (pPs == null)
                    {
                        Log.SaveLogToTxt("POWERSUPPLY =NULL");
                    }
                    if (pWavemeter == null)
                    {
                        Log.SaveLogToTxt("pWavemeter =NULL");
                    }
                    isOK = false;
                    OutPutandFlushLog();
                }
                if (isOK)
                {
                    selectedEquipList.Add("DUT", dut);
                }

                return(isOK);
            }
        }
Пример #29
0
        public void AddItemToEquipmentListTest()
        {
            EquipmentItem expectedItem = new EquipmentItem();

            expectedItem.EquipItemName = "TestItem1";
            expectedItem.EquipItemDesc = "TestItem1Desc";

            target.StoreEquipmentList(user, expectedList1);
            List <EquipmentList> lists = target.GetEquipmentLists(user);

            for (int i = 0; i < lists.Count; i++)
            {
                if (lists[i].EquipListName.Equals("TestList1") &&
                    lists[i].EquipListDesc.Equals("TestList1Desc"))
                {
                    EquipmentList actualList = lists[i];
                    target.AddItemToEquipmentList(user, actualList, expectedItem);
                    break;
                }
            }

            lists = target.GetEquipmentLists(user);

            Console.WriteLine("lists: " + lists.Count);

            List <EquipmentItem> items = null;

            for (int i = 0; i < lists.Count; i++)
            {
                if (lists[i].EquipListName.Equals("TestList1") &&
                    lists[i].EquipListDesc.Equals("TestList1Desc"))
                {
                    EquipmentList actualList = lists[i];
                    items = actualList.EquipListItems;

                    for (int j = 0; j < actualList.EquipListItems.Count; i++)
                    {
                        if (items[j].EquipItemName.Equals("TestItem1") &&
                            items[j].EquipItemDesc.Equals("TestItem1Desc"))
                        {
                            EquipmentItem actualItem = items[j];
                            Assert.AreEqual(expectedItem.EquipItemName, actualItem.EquipItemName);
                            Assert.AreEqual(expectedItem.EquipItemDesc, actualItem.EquipItemDesc);
                            break;
                        }
                    }
                    break;
                }
            }

            if (lists == null || lists.Count == 0 || items == null || items.Count == 0)
            {
                Assert.Fail();
            }
        }
Пример #30
0
 /// <summary>
 /// Constructor
 /// </summary>
 public BeerXmlData()
 {
     Equipment = new EquipmentList();
     Fermentables = new FermentableList();
     Hops = new HopList();
     Miscs = new MiscList();
     Recipes = new RecipeList();
     Styles = new StyleList();
     Waters = new WaterList();
     Yeasts = new YeastList();
 }
        public async Task <ActionResult> Edit([Bind(Include = "equipmentId,EquipmentType,EquipmentLocation,EquipmentCondition")] EquipmentList equipmentList)
        {
            if (ModelState.IsValid)
            {
                db.Entry(equipmentList).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(equipmentList));
        }
        public async Task <ActionResult> Create([Bind(Include = "equipmentId,EquipmentType,EquipmentLocation,EquipmentCondition")] EquipmentList equipmentList)
        {
            if (ModelState.IsValid)
            {
                db.equipmentLists.Add(equipmentList);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(equipmentList));
        }
Пример #33
0
 void Start()
 {
     player = GameObject.FindGameObjectWithTag ("Player").GetComponent<Player> ();
     inventory = GameObject.FindGameObjectWithTag ("Inventory").GetComponent<Inventory> ();
     equipList = FindObjectOfType<EquipmentList>();
     slotmanger = FindObjectOfType<SlotManger>();
 }
Пример #34
0
    void Start()
    {
        SpawnPlayer(); // Temp / Arre Barre

        equipmentList = new EquipmentList();
        weapon = equipmentList.GetWeapon( 0 );
        head = new EquipmentData( EquipmentData.Type.Head, "Naked", 1, 1f );
        body = new EquipmentData( EquipmentData.Type.Body, "Naked", 1, 1f );
        feet = new EquipmentData( EquipmentData.Type.Feet, "Naked", 1, 1f );
        money = 0;
    }
Пример #35
0
        private static string[] GetElementsStrings(Elements elements)
        {
            var zoneList = "";
            var zones = "";
            var buildingSurfaces = "";
            var fenestrationSurfaces = "";
            var shadingSurfaces = "";
            var shadingOverhangs = "";
            var materials = "";
            var constructions = "";

            var hvacEquipmentConnections = "";
            var hvacEquipementLists = "";
            var hvacIdealLoads = "";

            //Allways checks if the lists are full and writes a message in the idf-File if not
            var building = elements.Building == null ? "!No Building defined\n" : elements.Building.Write();

            if (elements.Zones.Count == 0)
            {
                //throw new ArgumentException("No Zones found");
                zones += "!No Zones defined\n";
            }

            foreach (var zone in elements.Zones)
            {
                //Downcast from NoDuplicate to Zone
                var realZone = (Zone) zone;
                zones += realZone.Write();

                var zc = new ZoneConnections(realZone);
                var eq = new EquipmentList(realZone);
                var ilas = new IdealLoadsAirSystem(realZone);

                hvacEquipmentConnections += zc.Write();
                hvacEquipementLists += eq.Write();
                hvacIdealLoads += ilas.Write();
            }

            zoneList = elements.ZoneLists.Aggregate(zoneList, (current, zList) => current + zList.Write());

            if (elements.Surfaces.Count == 0)
            {
                buildingSurfaces += "!No Surfaces defined\n";
            }
            else
            {
                buildingSurfaces = elements.Surfaces.Aggregate(buildingSurfaces, (current, surface) => current + surface.Write());
            }

            if (elements.FenestrationSurfaces.Count == 0)
            {
                fenestrationSurfaces += "!No FenestrationSurfaces defined\n";
            }
            else
            {
                fenestrationSurfaces = elements.FenestrationSurfaces.Aggregate(fenestrationSurfaces, (current, fenestrationSurface) => current + fenestrationSurface.Write());
            }

            if (elements.ShadingSurfaces.Count == 0)
            {
                shadingSurfaces += "!No ShadingSurfaces defined\n";
            }
            else
            {
                shadingSurfaces = elements.ShadingSurfaces.Aggregate(shadingSurfaces, (current, shadingSurface) => current + shadingSurface.Write());
            }

            if (elements.ShadingOverhangs.Count == 0)
            {
                shadingOverhangs += "!No ShadingOverhang defined\n";
            }
            else
            {
                shadingOverhangs = elements.ShadingOverhangs.Aggregate(shadingOverhangs, (current, shadingOverhang) => current + shadingOverhang.Write());
            }

            if (elements.Materials.Count == 0)
            {
                materials += "!No Materials defined\n";
            }
            else
            {
                materials = elements.Materials.Aggregate(materials, (current, material) => current + material.Write());
            }

            if (elements.Constructions.Count == 0)
            {
                constructions += "!No Constructions defined\n";
            }
            else
            {
                constructions = elements.Constructions.Aggregate(constructions, (current, construction) => current + construction.Write());
            }

            string[] lines =
            {
                GetHeadLine("BUILDING")+building,
                GetHeadLine("ZONELIST")+zoneList,
                GetHeadLine("ZONE")+zones,
                GetHeadLine("SURFACE")+buildingSurfaces,
                GetHeadLine("FENESTRATIONSURFACE")+fenestrationSurfaces,
                GetHeadLine("SHADINGSURFACE")+shadingSurfaces,
                GetHeadLine("SHADINHOVERHANG")+shadingOverhangs,
                GetHeadLine("MATERIAL")+materials,
                GetHeadLine("CONSTRUCTION")+constructions,
                GetHeadLine("HVAYEQUIPMENTCONNECTIONS")+hvacEquipmentConnections,
                GetHeadLine("HVACEQUIPMENTLIST")+hvacEquipementLists,
                GetHeadLine("HVACIDEALLOADS")+hvacIdealLoads
            };
            return lines;
        }