public void Start(RubyEnvironment rubyEnvironment)
 {
      _rack = new Rack(rubyEnvironment);
     _server = new SimpleWebServer(_listeningUris);
     _server.RequestHandlingError += RequestProcessingError;
     _server.IncomingRequest += ProcessRequest;
     _server.Start();
 }
        public IHttpActionResult Patch([FromODataUri] int key, Delta <Rack> patch)
        {
            Validate(patch.GetEntity());

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Rack rack = db.Rack.Find(key);

            if (rack == null)
            {
                return(NotFound());
            }

            patch.Patch(rack);

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!RackExists(key))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(Updated(rack));
        }
Beispiel #3
0
 public void SetRackReference(Rack rack)
 {
     this.rack = rack;
 }
Beispiel #4
0
        /// <summary>
        /// Metoda wyjmuje okreslona ilosc kostek z planszy i dodaje je do tabliczki
        /// </summary>
        /// <param name="Container"></param>
        /// <param name="StartIndex"></param>
        /// <param name="Word"></param>
        /// <param name="Rack"></param>
        public void RemoveTiles(Container Container, int StartIndex, int Number, Rack Rack)
        {
            for(int i = 0; i < Number; ++i)
            {
                Cell TempCell = Container.Get(StartIndex + i);

                if(!TempCell.IsVisited())
                {
                    Tile TempTile = TempCell.GetTile();
                    if(TempTile != null)
                    {
                        if(TempTile.IsBlank())
                        {
                            Rack.Add(new Tile(' ', true));
                        }
                        else
                        {
                            Rack.Add(TempTile);
                        }
                    }
                    TempCell.SetTile(null);
                }
            }
        }
        internal void AddComputer(string computerName, string hostName, string rackName,
                                  string processServer, string fileServer, string localDirectory)
        {
            Rack rack;
            lock (racks)
            {
                if (!racks.TryGetValue(rackName, out rack))
                {
                    rack = new Rack();
                    racks.Add(rackName, rack);
                }
            }

            Computer c = new Computer(computerName, hostName, rackName, rack.queue, clusterQueue,
                                      processServer, fileServer, localDirectory, logger);
            lock (computers)
            {
                computers.Add(computerName, c);
            }

            lock (localities)
            {
                List<Computer> cl;
                if (!localities.TryGetValue(hostName, out cl))
                {
                    cl = new List<Computer>();
                    localities.Add(hostName, cl);
                }

                cl.Add(c);
            }

            lock (rack)
            {
                Debug.Assert(!rack.computers.Contains(computerName));
                rack.computers.Add(computerName);
            }

            c.Start();
        }
Beispiel #6
0
    public void SpawnAnItem(Building thingToSpawn, int uiSlot = 999)
    {
        // We're spawning a RACK
        if (thingToSpawn.buildingID == 0)
        {
            if (!partnerKickedOut)
            {
                // Run the notification first to ask whether the player wants to remove his partner
                //FOR THIS TO WORK: Notification system must be enabled!
                AskAboutPartner();
                return;
            }

            if (racksBuilt == 3 && !furnitureSold)
            {
                // Run the notification first to ask whether the player wants to remove his furniture
                //FOR THIS TO WORK: Notification system must be enabled!
                AskAboutFurniture();
                return;
            }
            // Find an empty rackSlot to spawn into
            foreach (Transform slot in rackSlots)
            {
                // This needs to diversify between when the map supports multiple racks inside aslot, and when it doesn't

                // This doesn't need a second option, because the Upgrade script already checks whether to let the player press the button
                if (slot.childCount == 0)
                {
                    Rack newRack = GameObject.Instantiate(thingToSpawn.myBuildingPrefab, slot.position, Quaternion.identity, slot).GetComponent <Rack>();
                    racksBuilt++;
                    Debug.Log("Racks build is now " + racksBuilt);
                    slot.GetComponent <RackSlot>().racksInThisGroup++;
                    slot.GetComponent <RackSlot>().myRacks.Add(newRack);

                    // Passing in the slot number as well as the most basic rig, because this is a brand new rack

                    mapDelegateHolder.upgradedRackActions(itemDatabase.rigTypes[0], slot.GetComponent <RackSlot>().myOrderNumber);

                    return;
                }
            }
        }
        // We're spawning a RIG (this only works for the 4 RIG slots in each map)
        else if (thingToSpawn.buildingID == 1)
        {
            foreach (Transform slot in rigSlots)
            {
                if (slot.GetComponent <Rigslot>().myOrderNumber == uiSlot)
                {
                    // This is how we "spawn" a rig by just making it active in the scene
                    slot.GetChild(0).gameObject.SetActive(true);


                    // This line sets up the pricing for consequtive rigs
                    itemDatabase.rigTypes[1].priceOfNextUpgradeLvl = CalculatePriceOfNextBuilding(itemDatabase.rigTypes[0].priceOfNextUpgradeLvl, 1.5f, 2);

                    //Debug.Log(slot.GetComponentInChildren<RigScript>(true).me);

                    mapDelegateHolder.upgradedRigActions(slot.GetComponent <Rigslot>().myOrderNumber, slot.GetComponentInChildren <RigScript>(true).me);


                    rigsBuilt++;
                    return;
                }
            }
        }
        // We're upgrading a CHAIR
        else if (thingToSpawn.buildingID == 2)
        {
            // Find the current upgr lvl of chair and see if we need to upgrade the sprite.
            // Even if we don't, do some effects on the chair?
            if (chairUpgrade.currentUpgradeLvl <= chairUpgrade.maxUpgradeLvl)
            {
                int myUpgradeLvl = chairUpgrade.currentUpgradeLvl;
                chairSlot.GetComponent <SpriteRenderer>().sprite = itemDatabase.chairs[myUpgradeLvl];
                // Spawn an fx object on the newlsy changed sprite
                Instantiate(itemDatabase.accentFX, Vector2.zero, Quaternion.identity, chairSlot.transform);
            }
        }
        // We're upgrading a MONITOR
        else if (thingToSpawn.buildingID == 3)
        {
            if (monitorUpgrade.currentUpgradeLvl <= monitorUpgrade.maxUpgradeLvl)
            {
                int myUpgradeLvl = monitorUpgrade.currentUpgradeLvl;
                monitorSlot.GetComponent <SpriteRenderer>().sprite = itemDatabase.monitors[myUpgradeLvl];
                // Spawn an fx object on the newlsy changed sprite
                Instantiate(itemDatabase.accentFX, Vector2.zero, Quaternion.identity, monitorSlot.transform);
            }
        }
    }
 public RackRequestHandler(ILogWriter log, Rack rack)
 {
     _log = log;
     _rack = rack;
 }
Beispiel #8
0
 public void Update(Rack rack)
 {
     context.Racks.Update(rack);
     context.SaveChanges();
 }
 public void Start(RubyEnvironment rubyEnvironment, int tcpBacklog)
 {
     _rack = rubyEnvironment == null ? new Rack() : new Rack(rubyEnvironment);
     _server.Add(new RackRequestHandler(_logWriter, _rack));
     _server.Start(_ipAddress, _port);
 }
Beispiel #10
0
        public List <Rack> GetRacks()
        {
            List <Rack> racks = new List <Rack>();

            foreach (var areaNodeId in m_xmlSettings.Areas)
            {
                //LogManager.WriteLog(LogFile.Warning, $"GetRacks:AreaNo:{areaNodeId.AreaNo}");
                try
                {
                    byte[] group1 = (byte[])m_uaClient.ReadData(areaNodeId.Group_1).Value;
                    byte[] group2 = (byte[])m_uaClient.ReadData(areaNodeId.Group_2).Value;
                    byte[] group3 = (byte[])m_uaClient.ReadData(areaNodeId.Group_3).Value;
                    byte[] group4 = (byte[])m_uaClient.ReadData(areaNodeId.Group_4).Value;
                    byte[] group5 = (byte[])m_uaClient.ReadData(areaNodeId.Group_5).Value;

                    byte[] resArr = new byte[group1.Length + group2.Length + group3.Length + group4.Length + group5.Length];
                    group1.CopyTo(resArr, 0);
                    group2.CopyTo(resArr, group1.Length);
                    group3.CopyTo(resArr, group1.Length + group2.Length);
                    group4.CopyTo(resArr, group1.Length + group2.Length + group3.Length);
                    group5.CopyTo(resArr, group1.Length + group2.Length + group3.Length + group4.Length);


                    for (int i = 0; i < resArr.Length; i += 18)
                    {
                        Rack rack = new Rack();
                        rack.AreaNo        = areaNodeId.AreaNo;
                        rack.RackNo        = BitConverter.ToUInt16(resArr.Skip(i).Take(2).Reverse().ToArray(), 0);
                        rack.BatchNo       = BitConverter.ToUInt32(resArr.Skip(i + 2).Take(4).Reverse().ToArray(), 0);
                        rack.WorkpieceType = resArr.Skip(i + 6).Take(4).ToArray();
                        //rack.PrimerFirm = BitConverter.ToInt16(resArr.Skip(i + 8).Take(2).ToArray(), 0);
                        rack.PrimerColor = BitConverter.ToUInt16(resArr.Skip(i + 10).Take(2).Reverse().ToArray(), 0);
                        //rack.PrimerCraft = BitConverter.ToInt16(resArr.Skip(i + 12).Take(2).ToArray(), 0);
                        //rack.PigmentedCoatingFirm = BitConverter.ToInt16(resArr.Skip(i + 14).Take(2).ToArray(), 0);
                        rack.PigmentedCoatingColor = BitConverter.ToUInt16(resArr.Skip(i + 12).Take(2).Reverse().ToArray(), 0);
                        //rack.PigmentedCoatingCraft = BitConverter.ToInt16(resArr.Skip(i + 18).Take(2).ToArray(), 0);
                        //rack.VarnishFirm = BitConverter.ToInt16(resArr.Skip(i + 20).Take(2).ToArray(), 0);
                        rack.VarnishColor = BitConverter.ToUInt16(resArr.Skip(i + 14).Take(2).Reverse().ToArray(), 0);
                        //rack.VarnishCraft = BitConverter.ToInt16(resArr.Skip(i + 24).Take(2).ToArray(), 0);

                        int isZero = 0;

                        for (int j = 0; j < rack.WorkpieceType.Length; j++)
                        {
                            if (rack.WorkpieceType[j] == 0)
                            {
                                isZero++;
                            }
                        }

                        if (rack.RackNo == 0 && rack.BatchNo == 0 && isZero == 4 &&
                            rack.PrimerColor == 0 && rack.PrimerCraft == 0 && rack.PrimerFirm == 0 &&
                            rack.PigmentedCoatingColor == 0 && rack.PigmentedCoatingCraft == 0 &&
                            rack.PigmentedCoatingFirm == 0 && rack.VarnishColor == 0 &&
                            rack.VarnishCraft == 0 && rack.VarnishFirm == 0)
                        {
                            continue;
                        }

                        racks.Add(rack);
                    }
                }
                catch (Exception ex)
                {
                    //LogManager.WriteLog(LogFile.Trace, $"GetRacks:{ex.Message}");
                }
            }
            return(racks);
        }
        //=============================================================================
        // Aisle Space min length\width depends on the enabled MHE configurations of the document.
        //
        // If any parallel rack is adjusted to the aisle space then use PickingAisleWidth as
        // min aisle space length\width.
        //
        // If any perpendicular rack is adjusted to the aisle space then use CrossAisleWidth as
        // min aisle space length\width.
        //
        // If any block or wall is adjust to the aisle space then use EndAisleWidth as
        // min aisle space length\width.
        private double _GetMinAisleWidth()
        {
            if (Sheet != null && Sheet.Document != null)
            {
                double pickingWidth = Sheet.Document.PickingAisleWidth;
                double crossWidth   = Sheet.Document.CrossAisleWidth;
                double endWidth     = Sheet.Document.EndAisleWidth;

                // return if all width values are not a number
                if ((double.IsNaN(pickingWidth) || double.IsInfinity(pickingWidth)) &&
                    (double.IsNaN(crossWidth) || double.IsInfinity(crossWidth)) &&
                    (double.IsNaN(endWidth) || double.IsInfinity(endWidth)))
                {
                    return(0.0);
                }

                // try to find racks, blocks and walls which are adjusted to this aisle space
                Dictionary <Rack, Utils.eAdjustedSide> adjustedRacksDict = new Dictionary <Rack, Utils.eAdjustedSide>();
                bool bAdjustedBlockWallIsFound = false;
                foreach (BaseRectangleGeometry geom in Sheet.Rectangles)
                {
                    if (geom == null)
                    {
                        continue;
                    }

                    Rack rack = geom as Rack;
                    if (rack != null)
                    {
                        Utils.eAdjustedSide adjustedSide = Utils.GetAdjustedSide(this, rack);
                        if (Utils.eAdjustedSide.eNotAdjusted != adjustedSide)
                        {
                            adjustedRacksDict[rack] = adjustedSide;
                        }

                        continue;
                    }

                    if (!bAdjustedBlockWallIsFound && (geom is Block || geom is Wall))
                    {
                        Utils.eAdjustedSide adjustedSide = Utils.GetAdjustedSide(this, geom);
                        if (Utils.eAdjustedSide.eNotAdjusted != adjustedSide)
                        {
                            bAdjustedBlockWallIsFound = true;
                        }

                        continue;
                    }
                }

                bool isPickingAisleWidthIncluded = !double.IsNaN(pickingWidth) && !double.IsInfinity(pickingWidth);
                bool isCrossAisleWidthIncluded   = !double.IsNaN(crossWidth) && !double.IsInfinity(crossWidth);
                bool isEndAisleWidthIncluded     = !double.IsNaN(endWidth) && !double.IsInfinity(endWidth);
                // try to get Picking Aisle Width - find parallel rack
                // try to get Cross Aisle Width - find perpendicular rack
                bool bAdjustedParallelRackIsFound      = false;
                bool bAdjustedPerpendicularRackIsFound = false;
                if (isPickingAisleWidthIncluded || isCrossAisleWidthIncluded)
                {
                    foreach (Rack rack in adjustedRacksDict.Keys)
                    {
                        if (rack == null)
                        {
                            continue;
                        }

                        Utils.eAdjustedSide adjustedSide = adjustedRacksDict[rack];
                        if (Utils.eAdjustedSide.eNotAdjusted == adjustedSide)
                        {
                            continue;
                        }

                        if (Utils.eAdjustedSide.eLeft == adjustedSide || Utils.eAdjustedSide.eRight == adjustedSide)
                        {
                            if (!rack.IsHorizontal)
                            {
                                bAdjustedParallelRackIsFound = true;
                            }
                            else
                            {
                                bAdjustedPerpendicularRackIsFound = true;
                            }
                        }
                        else if (Utils.eAdjustedSide.eTop == adjustedSide || Utils.eAdjustedSide.eBot == adjustedSide)
                        {
                            if (rack.IsHorizontal)
                            {
                                bAdjustedParallelRackIsFound = true;
                            }
                            else
                            {
                                bAdjustedPerpendicularRackIsFound = true;
                            }
                        }

                        if (bAdjustedParallelRackIsFound && bAdjustedPerpendicularRackIsFound)
                        {
                            break;
                        }
                    }
                }

                if (isPickingAisleWidthIncluded && bAdjustedParallelRackIsFound &&
                    (!isCrossAisleWidthIncluded || !bAdjustedPerpendicularRackIsFound || (isCrossAisleWidthIncluded && bAdjustedPerpendicularRackIsFound && Utils.FGT(pickingWidth, crossWidth))) &&
                    (!isEndAisleWidthIncluded || !bAdjustedBlockWallIsFound || (isEndAisleWidthIncluded && bAdjustedBlockWallIsFound && Utils.FGT(pickingWidth, endWidth))))
                {
                    return(pickingWidth);
                }
                else if (isCrossAisleWidthIncluded && bAdjustedPerpendicularRackIsFound &&
                         (!isEndAisleWidthIncluded || !bAdjustedBlockWallIsFound || (isEndAisleWidthIncluded && bAdjustedBlockWallIsFound && Utils.FGT(crossWidth, endWidth))))
                {
                    return(crossWidth);
                }
                else if (isEndAisleWidthIncluded && bAdjustedBlockWallIsFound)
                {
                    return(endWidth);
                }
            }

            return(0.0);
        }
        //Event handlers
        private void Form4_Load(object sender, EventArgs e)
        {
            rackcounter++;
            rack = new Rack(cabinetkit.Depth, cabinetkit.Width);
            label1_form4.Text = "Rack " + rackcounter.ToString() + " details";
            if (cabinetkit.Identical_rack_height == true)
            {
                label4_form4.Enabled        = false;
                comboBx_rackheight4.Enabled = false;
            }
            else
            {
                label4_form4.Enabled        = true;
                comboBx_rackheight4.Enabled = true;
            }
            //Set rack height accordingly
            if (cabinetkit.Identical_rack_height == true)
            {
                rack.Height = cabinetkit.Identical_rack_heights;
            }
            if (updateMode_flag == true && (numberOfracks <= cabinetkit.Nbr_racks))
            {
                try
                {
                    //Prefill
                    if (cabinetkit.Identical_rack_height == false)
                    {
                        comboBx_rackheight4.Text = cabinetkit.List_of_racks[indx].Height.ToString();
                    }
                    Element element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Right Panel");
                    comboBx_Rpanel4.Text = element.Color;
                    element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Left Panel");
                    comboBx_LPanel4.Text = element.Color;
                    element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Rear Panel");
                    comboBx_RearPanel4.Text = element.Color;
                    element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Top Panel");
                    comboBx_topPanel.Text = element.Color;
                    element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Bottom Panel");
                    comboBx_BottmPanel.Text = element.Color;
                    element = cabinetkit.Steel_corner_bars.Find(a => a.Name == "Steel corner Bar" || a.Name == "Steel corner bar (Cut)");
                    comboBx_SteelCornerBr.Text = element.Color;

                    if (cabinetkit.List_of_racks[indx].List_of_elements.Exists(a => a.Name == "Left Door" || a.Name == "Handle"))
                    {
                        checkBx_rackdoors4.Checked = cabinetkit.List_of_racks[indx].Door_addition;
                        element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Left Door");
                        comboBx_doorcolor4.Text = element.Color;
                        element = cabinetkit.List_of_racks[indx].List_of_elements.Find(x => x.Name == "Right Door");
                        comboBx_rightdoor.Text       = element.Color;
                        checkBx_rackhandles4.Checked = cabinetkit.List_of_racks[indx].Handle_addition;
                    }
                }
                catch (ArgumentOutOfRangeException)
                {
                    comboBx_Rpanel4.Text       = "";
                    comboBx_LPanel4.Text       = "";
                    comboBx_RearPanel4.Text    = "";
                    comboBx_topPanel.Text      = "";
                    comboBx_BottmPanel.Text    = "";
                    comboBx_SteelCornerBr.Text = "";
                    comboBx_doorcolor4.Text    = "";
                    comboBx_rightdoor.Text     = "";
                }
            }
        }
 public void Update(Rack entity)
 {
     _provider.Perform(con => con.Update(entity));
 }
 public IISHttpHandlerFactory()
 {
     _rack = new Rack();
 }
Beispiel #15
0
 protected Player(Model GameModel)
 {
     Rack = new Rack();
     PointsNumber = 0;
     this.GameModel = GameModel;
 }
Beispiel #16
0
        public async Task <IActionResult> Create([Bind("IncubatorModelId,MonitoringDeviceId,Id,Name,Description,IdentityUserId")] Incubator incubator)
        {
            var monitoringDevices = _context.MonitoringDevices.Select(m => m.Id).ToList();

            var incubatorsMonitoringDevices = _context.Incubators.Select(i => i.MonitoringDeviceId).ToList();

            if (incubator.MonitoringDeviceId != 0 && !monitoringDevices.Contains(incubator.MonitoringDeviceId))
            {
                ViewBag.NoMonitoringDevice   = true;
                ViewData["IncubatorModelId"] = new SelectList(_context.Set <IncubatorModel>(), "Id", "Capacity", incubator.IncubatorModelId);
                return(View(incubator));
            }

            if (incubator.MonitoringDeviceId == 0)
            {
                incubator.MonitoringDeviceId = 2;
            }

            incubator.IdentityUser = await GetCurrentUserAsync();

            incubator.IdentityUserId = await GetCurrentUserId();

            if (ModelState.IsValid)
            {
                var dateAdded = DateTime.Now.Date;

                _context.Add(incubator);

                await _context.SaveChangesAsync();

                incubator = _context.Incubators.Include(i => i.IncubatorModel).SingleOrDefault(i => i.Id == incubator.Id);
                for (byte rack = 1; rack <= incubator.IncubatorModel.RackHeight; rack++)
                {
                    var rackIn = new Rack
                    {
                        IncubatorId = incubator.Id,
                        RackNumber  = rack,
                    };

                    _context.Add(rackIn);
                    await _context.SaveChangesAsync();

                    for (byte rackCol = 1; rackCol <= incubator.IncubatorModel.RackLength; rackCol++)
                    {
                        for (byte rackRow = 1; rackRow <= incubator.IncubatorModel.RackWidth; rackRow++)
                        {
                            var tray = new Tray
                            {
                                Column               = rackCol,
                                Row                  = rackRow,
                                EggTypeId            = _context.EggTypes.SingleOrDefault(eT => eT.Name == "None").Id,
                                RackId               = _context.Racks.Where(r => r.IncubatorId == incubator.Id).SingleOrDefault(r => r.RackNumber == rack).Id,
                                DateAdded            = DateTime.Now.Date,
                                CandlingDate         = DateTime.Now.Date,
                                HatchPreparationDate = DateTime.Now.Date,
                                HatchDate            = DateTime.Now.Date
                            };

                            _context.Add(tray);
                            await _context.SaveChangesAsync();
                        }
                    }
                }

                return(RedirectToAction(nameof(Index)));
            }

            ViewData["IncubatorModelId"] = new SelectList(_context.Set <IncubatorModel>(), "Id", "Capacity", incubator.IncubatorModelId);
            return(View(incubator));
        }
Beispiel #17
0
 public void Delete(Rack obj)
 {
     session.Delete(obj);
 }
 public void Stop()
 {
     if (_server != null)
         _server.Stop();
     _rack = null;
 }
Beispiel #19
0
 public void Update(Rack obj)
 {
     session.Update(obj);
 }
 public void DeleteRack(Rack rack)
 {
     racks.Remove(rack);
 }
Beispiel #21
0
 public void Update(Rack rack)
 {
     rackRepository.Update(rack);
 }
        public void UpdateRack(Rack rack)
        {
            Rack rackToUpdate = racks.Where(c => c.RackID == rack.RackID).FirstOrDefault();

            rackToUpdate = rack;
        }
Beispiel #23
0
    public void UpgradeARackOfRigs(int rackSlot, Rack rackToUpgrade = null)
    {
        // TODO: figure out whether this actually does anything
        if (!rackToUpgrade)
        {
            foreach (Transform slot in rackSlots)
            {
                //Checking my rack ID to find the one we want to upgrade
                if (slot.GetComponent <RackSlot>().myOrderNumber == rackSlot)
                {
                    //Debug.Log("About to upgrade this rack!");
                    RigScript[] rigslotsInThisRackGroup;
                    // Collecting all the RIGSCRIPTS inside this RACKSLOT to the update them
                    rigslotsInThisRackGroup = slot.GetComponentsInChildren <RigScript>(true);

                    // Find out if we have enough money to upgrade all the rigs in this group
                    if (rigslotsInThisRackGroup[0].me.priceOfNextUpgradeLvl * rigslotsInThisRackGroup.Length < miningControllerInstance.myMiningController.currentBalance)
                    {
                        // Charge me the money for the upgrade of the 3 rigs in the group
                        miningControllerInstance.myMiningController.currentBalance -= rigslotsInThisRackGroup[0].me.priceOfNextUpgradeLvl * rigslotsInThisRackGroup.Length;
                        //Debug.Log("Charged you " + rigslotsInThisRackGroup[0].me.priceOfNextUpgradeLvl * rigslotsInThisRackGroup.Length + " for the upgrades on the rack");

                        // The actual rig upgrade process
                        foreach (RigScript rig in rigslotsInThisRackGroup)
                        {
                            //Debug.Log(rig.me);
                            //Debug.Log("My rig id is now " + rig.me.id);
                            rig.me = itemDatabase.rigTypes[rig.me.id + 1];
                            //Debug.Log("My rig id is now " + rig.me.id);
                            rig.RefreshIcon();
                        }
                        // Getting info from one of the rigs in the bunch
                        RigScript rigSample = rigslotsInThisRackGroup[0];
                        // APPLYING THE UPGRADE'S EFFECTS (this will be multiplied by 3, because there are 3 rigs in each rack
                        miningControllerInstance.IncreaseMinMaxMiningSpeed(rigSample.me.myEffectOnMining * 3);

                        //Send in the info to the UI so it can be udpated with the newly updated rig info for this rag
                        Debug.Log("Spawning a " + rigslotsInThisRackGroup[0].me);
                        mapDelegateHolder.upgradedRackActions(rigslotsInThisRackGroup[0].me, rackSlot);


                        return;
                    }
                    Debug.Log("Not enough money to upgrade all the rigs in this group!");
                    return;
                }
            }
        }
        else
        {
            Debug.Log("About to upgrade a specific rack!");
            RigScript[] rigslotsInThisRackGroup;
            // Collecting all the RIGSCRIPTS inside this RACKSLOT to the update them
            rigslotsInThisRackGroup = rackToUpgrade.GetComponentsInChildren <RigScript>(true);

            if (rigslotsInThisRackGroup[0].me.priceOfNextUpgradeLvl * rigslotsInThisRackGroup.Length < miningControllerInstance.myMiningController.currentBalance)
            {
                // Charge me the money for the upgrade
                miningControllerInstance.myMiningController.currentBalance -= rigslotsInThisRackGroup[0].me.priceOfNextUpgradeLvl * rigslotsInThisRackGroup.Length;
                //Debug.Log("Charged you " + rigslotsInThisRackGroup[0].me.priceOfNextUpgradeLvl * rigslotsInThisRackGroup.Length + " for the upgrades on the rack");

                foreach (RigScript rig in rigslotsInThisRackGroup)
                {
                    Debug.Log(rig.me);
                    //Debug.Log("My rig id is now " + rig.me.id);
                    rig.me = itemDatabase.rigTypes[rig.me.id + 1];
                    //Debug.Log("My rig id is now " + rig.me.id);
                    rig.RefreshIcon();

                    miningControllerInstance.IncreaseMinMaxMiningSpeed(rig.me.myEffectOnMining);
                }
                Debug.Log("Spawning a " + rigslotsInThisRackGroup[0].me);
                mapDelegateHolder.upgradedRackActions(rigslotsInThisRackGroup[0].me, rackSlot);

                //Debug.Log("I've upgraded all the rigs in this group!");
                return;
            }
            Debug.Log("Not enough money to upgrade all the rigs in this group!");
            return;
        }
    }
        private List <Rack> LoadMockRacks()
        {
            List <Observation> observations = new List <Observation>()
            {
                new Observation {
                    ObservationID = 1, Temperature = 20.0, RegionID = 1, Humidity = 5.0, AirPressure = 11.9, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 2, Temperature = 21.0, RegionID = 1, Humidity = 6.1, AirPressure = 12.8, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 3, Temperature = 18.1, RegionID = 2, Humidity = 7.2, AirPressure = 13.7, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 4, Temperature = 24.2, RegionID = 2, Humidity = 8.9, AirPressure = 10.5, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 5, Temperature = 20.2, RegionID = 3, Humidity = 10.1, AirPressure = 12.4, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 6, Temperature = 23.6, RegionID = 3, Humidity = 2.3, AirPressure = 11.3, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 7, Temperature = 24.1, RegionID = 4, Humidity = 2.3, AirPressure = 10.2, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 8, Temperature = 21.2, RegionID = 4, Humidity = 4.5, AirPressure = 13.2, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 9, Temperature = 24.2, RegionID = 5, Humidity = 6.6, AirPressure = 14.2, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 10, Temperature = 28.2, RegionID = 5, Humidity = 2.3, AirPressure = 15.2, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 11, Temperature = 24.8, RegionID = 6, Humidity = 5.4, AirPressure = 11.2, Timestamp = DateTime.Now
                },
                new Observation {
                    ObservationID = 12, Temperature = 15.9, RegionID = 6, Humidity = 5.8, AirPressure = 10.2, Timestamp = DateTime.Now
                }
            };

            List <Product> tshirts = new List <Product>()
            {
                new Product {
                    ProductID = 16, ProductName = "T-Shirt S", RackID = 4, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 17, ProductName = "T-Shirt M", RackID = 4, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 18, ProductName = "T-Shirt L", RackID = 4, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 19, ProductName = "T-Shirt XL", RackID = 4, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 20, ProductName = "T-Shirt XXL", RackID = 4, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                }
            };

            List <Product> broeken = new List <Product>()
            {
                new Product {
                    ProductID = 21, ProductName = "Broek S", RackID = 5, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 22, ProductName = "Broek M", RackID = 5, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 23, ProductName = "Broek L", RackID = 5, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 24, ProductName = "Broek XL", RackID = 5, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                },
                new Product {
                    ProductID = 25, ProductName = "Broek XXL", RackID = 5, MaximumAirPressure = 20, MaximumHumidity = 20, MaximumTemperature = 20, MinimumAirPressure = 10, MinimumHumidity = 10, MinimumTemperature = 10
                }
            };

            Rack rack1 = new Rack {
                RackID = 4, RegionID = 2, Products = tshirts
            };
            Rack rack2 = new Rack {
                RackID = 5, RegionID = 2, Products = broeken
            };

            List <Rack> racks = new List <Rack>();

            racks.Add(rack1);
            racks.Add(rack2);

            return(racks);
        }
Beispiel #25
0
    ///<summary>
    /// Deserialize a SInteract command and run it.
    ///</summary>
    ///<param name="_data">The serialized command to execute</param>
    private void InteractWithObject(string _data)
    {
        List <string> usableParams;
        SInteract     command = JsonConvert.DeserializeObject <SInteract>(_data);
        OgreeObject   obj     = Utils.GetObjectById(command.id).GetComponent <OgreeObject>();

        switch (obj.category)
        {
        case "room":
            Room room = (Room)obj;
            usableParams = new List <string>()
            {
                "tilesName", "tilesColor"
            };
            if (usableParams.Contains(command.param))
            {
                room.SetAttribute(command.param, command.value);
            }
            else
            {
                Debug.LogWarning("Incorrect room interaction");
            }
            break;

        case "rack":
            Rack rack = (Rack)obj;
            usableParams = new List <string>()
            {
                "label", "labelFont", "alpha", "slots", "localCS", "U"
            };
            if (usableParams.Contains(command.param))
            {
                rack.SetAttribute(command.param, command.value);
            }
            else
            {
                Debug.LogWarning("Incorrect rack interaction");
            }
            break;

        case "device":
            OObject device = (OObject)obj;
            usableParams = new List <string>()
            {
                "label", "labelFont", "alpha", "slots", "localCS"
            };
            if (usableParams.Contains(command.param))
            {
                device.SetAttribute(command.param, command.value);
            }
            else
            {
                Debug.LogWarning("Incorrect device interaction");
            }
            break;

        default:
            GameManager.gm.AppendLogLine("Unknown category to interact with", true, eLogtype.warning);
            break;
        }
    }
Beispiel #26
0
        private void ReloadFrm()
        {
            int Top  = panel.Top;
            int Left = panel.Left;

            int tabIndex           = tbTester.TabIndex + 1;
            int maxBoardNumPerRack = 0;

            //根据待测试板卡初始化配置界面
            this.panel.Controls.Clear();
            int ControlHeight = 25;
            int LblWidth      = 150;
            int InputWidth    = 150;
            int tMax          = 0;

            for (int i = 0; i < testedRacks.Racks.Count; i++)
            {
                Rack r = testedRacks.Racks[i];
                if (r.IsTested)
                {
                    Label lbl = new Label();
                    lbl.Text   = string.Format("{0}# {1}:", r.No, r.Name);
                    lbl.Top    = 5 + 30 * tMax;
                    lbl.Left   = 5;
                    lbl.Width  = LblWidth;
                    lbl.Height = ControlHeight;
                    this.panel.Controls.Add(lbl);
                    TextBox tb = new TextBox();
                    tb.Text     = r.SN;
                    tb.Left     = lbl.Right + 10;
                    tb.Top      = lbl.Top;
                    tb.Width    = InputWidth;
                    tb.Height   = ControlHeight;
                    tb.TabIndex = tabIndex++;
                    tb.Tag      = r;
                    tb.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbTester_KeyDown);
                    this.panel.Controls.Add(tb);
                    tMax++;
                }
                if (tMax > maxBoardNumPerRack)
                {
                    maxBoardNumPerRack = tMax;
                }
            }
            if (maxBoardNumPerRack == 0)
            {
                Label lbl = new Label();
                lbl.Text   = "没有待测试板卡,请先到主界面的左边板卡树上选择需要待测试的板卡,然后设置SN号等信息。";
                lbl.Top    = 5;
                lbl.Left   = 5;
                lbl.Width  = 600;
                lbl.Height = 25;
                this.panel.Controls.Add(lbl);
            }

            //重置窗口大小和按钮位置
            this.panel.Height    = (ControlHeight + 5) * (maxBoardNumPerRack > 0 ? maxBoardNumPerRack : 1) + 5;
            btnOk.Top            = this.panel.Bottom + 10;
            btnOk.TabIndex       = tabIndex++;
            btnCancel.Top        = btnOk.Top;
            btnCancel.TabIndex   = tabIndex++;
            btnReadBack.Top      = btnOk.Top;
            btnReadBack.TabIndex = tabIndex++;
            this.Height          = btnOk.Bottom + 35;

            tbTester.Text = testedRacks.Tester;
            tbTester.Focus();
        }
Beispiel #27
0
        /// <summary>
        /// Metoda wstawia kostki w odpowiednie miejsce na planszy i usuwa je z tabliczki gracza
        /// </summary>
        /// <param name="Container"></param>
        /// <param name="StartCell"></param>
        /// <param name="Word"></param>
        /// <param name="Rack"></param>
        public void PutTiles(Container Container, int StartIndex, Dictionary.Dictionary.WordFound Word, Rack Rack)
        {
            String NewWord = Word.GetWord();

            for(int i = 0; i < NewWord.Length; ++i)
            {
                Cell TempCell = Container.Get(StartIndex + i);

                if(!TempCell.IsVisited())
                {
                    TempCell.SetTile(Rack.Contains(NewWord[i]) ? new Tile(NewWord[i]) : new Tile(NewWord[i], true));

                    Rack.Remove(NewWord[i]);
                }
            }
        }
Beispiel #28
0
 public void UpdateRack(Rack rack)
 {
     throw new NotImplementedException();
 }
Beispiel #29
0
 public IISHttpHandler(Rack rack)
 {
     _rack = rack;
 }
Beispiel #30
0
        public static void Main(string[] args)
        {
            Console.WriteLine("\t\t\t*** KIT_BOX beta ***\t\t\t");

            while (true)
            {
                Console.WriteLine("Céez votre armoire personnalisée (^_^)\nEntrer la largeur :");
                int weight = Convert.ToInt32(Console.ReadLine());
                Console.Write("\nEntrez la profondeur : ");
                int depth = Convert.ToInt32(Console.ReadLine());
                Console.Write("la base de votre étagere a ete choisie: " + weight + " Cm x " + depth + " Cm");
                Console.Write("\nEntrez la hauteur du premier casier : ");
                int height = Convert.ToInt32(Console.ReadLine());

                Dimensions UDpanel_dim    = new Dimensions(0, weight, depth);
                Dimensions LRpanel_dim    = new Dimensions(height, 0, depth);
                Dimensions Battens_dim    = new Dimensions(height, 0, 0);
                Dimensions Backpannel_dim = new Dimensions(height, weight, 0);
                Dimensions FBcrossbar_dim = new Dimensions(0, weight, 0);
                Dimensions LRcrossbar_dim = new Dimensions(0, 0, depth);

                Console.Write("\nEntrez la couleur de votre casier: ");
                string color = Console.ReadLine();

                Console.Write("\nEntrez la couleur de porte du casier: ");
                string color_Door = Console.ReadLine();

                Battens bat = new Battens("Battens", 2, null, Battens_dim);
                bat.SetDimensions(Battens_dim);
                UDpanel udpanel = new UDpanel("UDpanel", 3, color, UDpanel_dim);
                udpanel.SetDimensions(UDpanel_dim);
                LRpanel lrpanel = new LRpanel("LRpanel", 2, color);
                lrpanel.SetDimensions(LRpanel_dim);
                BackPanel backpanel = new BackPanel("BackPanel", 5, color, Backpannel_dim);
                backpanel.SetDimensions(Backpannel_dim);
                FBCrossbar fbcrossbar = new FBCrossbar("FBCrossbar", 1);
                fbcrossbar.SetDimensions(FBcrossbar_dim);
                LRcrossbar lrcrossbar = new LRcrossbar("LRcrossbar", 1);
                lrcrossbar.SetDimensions(LRcrossbar_dim);
                AngleBar anglebar = new AngleBar("AngleBar", 4, color);
                anglebar.SetDimensions(Battens_dim);
                Door door = new Door("Door", 5, color_Door, FBcrossbar_dim);

                Rack rack = new Rack(bat, lrpanel, udpanel, backpanel, fbcrossbar, lrcrossbar, anglebar, door);


                Console.WriteLine("\ncaracteristique du casier 1 :");

                Console.WriteLine(rack.ToString());

                Console.WriteLine("\nEntrez la hauteur du casier 2 :");
                int height2 = Convert.ToInt32(Console.ReadLine());
                Console.WriteLine("voulez vous garder les mêmes couleur que le casier 1 ? [oui/non] ");
                string condition = Console.ReadLine();

                if (condition == "non")
                {
                    Dimensions LRpanel_dim2    = new Dimensions(height2, 0, depth);
                    Dimensions Battens_dim2    = new Dimensions(height2, 0, 0);
                    Dimensions Backpannel_dim2 = new Dimensions(height2, weight, 0);


                    Console.WriteLine("\nEntrez la couleur du casier 2: ");
                    string color2 = Console.ReadLine();
                    Console.WriteLine("\nEntrez la couleur de la porte du casier 2: ");
                    string color_Door2 = Console.ReadLine();
                    Console.WriteLine("\nLes caracteristiques du casier 2 :");
                    Battens bat2 = new Battens("Battens", 2, null, Battens_dim2);
                    bat.SetDimensions(Battens_dim2);

                    LRpanel lrpanel2 = new LRpanel("LRpanel", 2, color2);
                    lrpanel2.SetDimensions(LRpanel_dim2);
                    BackPanel backpanel2 = new BackPanel("BackPanel", 5, color2, Backpannel_dim2);
                    backpanel.SetDimensions(Backpannel_dim);


                    AngleBar anglebar2 = new AngleBar("AngleBar", 4, color2);
                    anglebar2.SetDimensions(Battens_dim2);
                    Door door2 = new Door("Door", 5, color_Door2, FBcrossbar_dim);

                    Rack rack2 = new Rack(bat2, lrpanel2, udpanel, backpanel2, fbcrossbar, lrcrossbar, anglebar2, door2);
                    Console.WriteLine(rack2.ToString());

                    Shelf shelf = new Shelf();
                    shelf.AddRack(rack);
                    shelf.AddRack(rack2);

                    Console.WriteLine("Propriétés Armoire :");
                    Console.WriteLine(shelf.ToString(1));
                    Console.WriteLine(shelf.ToString(2));

                    Console.WriteLine("\nPour modifier un casier entez son numero: ");
                    int num = Convert.ToInt32(Console.ReadLine());
                    Console.WriteLine(shelf.ToString(num));
                }
                else
                {
                    Console.WriteLine("\nLes caracteristiques du casier 2 :");
                }

                Console.WriteLine();
            }
        }
Beispiel #31
0
 public void SendSpecificRack(Rack rack)
 {
     //calls the getdata of the rack object passed
     rack.getData();
 }
Beispiel #32
0
        public static void Initialize(DataContext context)
        {
            context.Database.EnsureCreated();

            // Individual
            var individual = new Individual("John", "Askew");

            if (!context.Set <Individual>().Any())
            {
                context.Set <Individual>().Add(individual);
                context.SaveChanges();
            }

            // League
            var league = new League("Workmen's Hall of Norwood");

            if (!context.Set <League>().Any())
            {
                context.Set <League>().Add(league);
                context.SaveChanges();

                //Team
                var team = new Team("My Team", league.Id);

                if (!context.Set <Team>().Any())
                {
                    context.Set <Team>().Add(team);
                    context.SaveChanges();

                    // Team Member
                    var teamMember = new TeamMember(team, individual, 96);

                    if (!context.Set <TeamMember>().Any())
                    {
                        context.Set <TeamMember>().Add(teamMember);
                        context.SaveChanges();

                        // Season
                        var season = new Season(DateTime.Today.Subtract(TimeSpan.FromDays(20)), DateTime.Today.Add(TimeSpan.FromDays(20)), league.Id);

                        if (!context.Set <Season>().Any())
                        {
                            context.Set <Season>().Add(season);
                            context.SaveChanges();

                            // Fixture
                            var fixture = new Fixture(DateTime.Today, team, team, season.Id);

                            if (!context.Set <Fixture>().Any())
                            {
                                context.Set <Fixture>().Add(fixture);
                                context.SaveChanges();

                                // Game
                                var game = new Game(teamMember, teamMember, fixture.Id);

                                if (!context.Set <Game>().Any())
                                {
                                    context.Set <Game>().Add(game);
                                    context.SaveChanges();

                                    // Rack
                                    var rack = new Rack(14, 6, game.Id);

                                    if (!context.Set <Rack>().Any())
                                    {
                                        context.Set <Rack>().Add(rack);
                                        context.SaveChanges();
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #33
0
 public void Update(Rack obj)
 {
     session.SaveOrUpdate(obj);
 }
Beispiel #34
0
        private void setDdjData(CGKddj lastddj, CGKddj thisddj, int[] xmlIndex, int DdjId)
        {
            int DDJXmlIndex_state        = xmlIndex[0];
            int DDJXmlIndex_tgt          = xmlIndex[1];
            int DDJXmlIndex_source       = xmlIndex[2];
            int DDJXmlIndex_forktgt      = xmlIndex[3];
            int DDJXmlIndex_platformtgt  = xmlIndex[4];
            int DDJXmlIndex_pallertstate = xmlIndex[5];

            //堆垛机去取托盘的时候高亮显示目标托盘
            Rack r = getRackIdByModel(lastddj, thisddj, DdjId);

            if (r != null)
            {
                RackBll rb = new RackBll();
                rb.InsertRack(r);
            }
            lastddj = setOutModelDdj(lastddj);
            thisddj = setOutModelDdj(thisddj);


            if (lastddj == null)
            {
                if (thisddj.CGKddj_current == thisddj.CGKddj_tgt)
                {
                    ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_source, thisddj.CGKddj_tgt);
                }
                else
                {
                    ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_source, thisddj.CGKddj_source);
                }
                ComTCPLib.SetOutputAsUINT(1, DDJXmlIndex_state, thisddj.CGKddj_state);
                ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_tgt, thisddj.CGKddj_tgt);
                ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_forktgt, thisddj.CGKddj_forktgt);
                ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_platformtgt, thisddj.CGKddj_platformtgt);
                ComTCPLib.SetOutputAsUINT(1, DDJXmlIndex_pallertstate, thisddj.CGKddj_pallertstate);
            }
            else if (!thisddj.Equals(lastddj))
            {
                if (thisddj.CGKddj_current == thisddj.CGKddj_tgt)
                {
                    ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_source, thisddj.CGKddj_tgt);
                }
                else
                {
                    if (thisddj.CGKddj_source != lastddj.CGKddj_source)
                    {
                        ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_source, thisddj.CGKddj_source);
                    }
                }
                if (thisddj.CGKddj_state != lastddj.CGKddj_state)
                {
                    ComTCPLib.SetOutputAsUINT(1, DDJXmlIndex_state, thisddj.CGKddj_state);
                }
                if (thisddj.CGKddj_tgt != lastddj.CGKddj_tgt)
                {
                    ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_tgt, thisddj.CGKddj_tgt);
                }
                if (thisddj.CGKddj_forktgt != lastddj.CGKddj_forktgt)
                {
                    ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_forktgt, thisddj.CGKddj_forktgt);
                }
                if (thisddj.CGKddj_platformtgt != lastddj.CGKddj_platformtgt)
                {
                    ComTCPLib.SetOutputAsREAL32(1, DDJXmlIndex_platformtgt, thisddj.CGKddj_platformtgt);
                }
                if (thisddj.CGKddj_pallertstate != lastddj.CGKddj_pallertstate)
                {
                    ComTCPLib.SetOutputAsUINT(1, DDJXmlIndex_pallertstate, thisddj.CGKddj_pallertstate);
                }
            }
        }
Beispiel #35
0
 public void Add(Rack rack)
 {
     context.Racks.Add(rack);
     context.SaveChanges();
 }
Beispiel #36
0
 private Rack getRackIdByModel(CGKddj lastddj, CGKddj thisddj, int DdjId)
 {
     //当托盘无货 且 当前叉子和载货台目标不和上次相同时
     if ((lastddj == null || (thisddj.CGKddj_tgt != lastddj.CGKddj_tgt || thisddj.CGKddj_forktgt != lastddj.CGKddj_forktgt || thisddj.CGKddj_platformtgt != lastddj.CGKddj_platformtgt)) && (int)thisddj.CGKddj_forktgt != 0 && thisddj.CGKddj_pallertstate == 0)
     {
     }
     else
     {
         return(null);
     }
     WZYB.Model.Rack r = new Rack();
     //堆垛机的坐标和货位生成的坐标是反的
     r.Rack_colum = 38 - (uint)thisddj.CGKddj_tgt;
     r.Rack_row   = 13 - (uint)thisddj.CGKddj_platformtgt;
     if (DdjId == 1)
     {
         if ((int)thisddj.CGKddj_forktgt == 1)
         {
             r.Rack_z = 1;
         }
         else if ((int)thisddj.CGKddj_forktgt == 2)
         {
             r.Rack_z = 0;
         }
         r.Rack_type = 1;
     }
     else if (DdjId == 2)
     {
         if ((int)thisddj.CGKddj_forktgt == 1)
         {
             r.Rack_z = 3;
         }
         else if ((int)thisddj.CGKddj_forktgt == 2)
         {
             r.Rack_z = 2;
         }
         r.Rack_type = 1;
     }
     else if (DdjId == 3)
     {
         if ((int)thisddj.CGKddj_forktgt == 1)
         {
             r.Rack_z = 0;
         }
         else if ((int)thisddj.CGKddj_forktgt == 2)
         {
             r.Rack_z = 1;
         }
         else if ((int)thisddj.CGKddj_forktgt == 3)
         {
             r.Rack_z = 2;
         }
         else if ((int)thisddj.CGKddj_forktgt == 4)
         {
             r.Rack_z = 3;
         }
         r.Rack_type = 2;
     }
     r.Rack_id    = 1;
     r.Rack_state = r.Rack_type * 10 + 2;
     return(r);
 }
Beispiel #37
0
 public void Insert(Rack obj)
 {
     session.Save(obj);
 }
Beispiel #38
0
        public Rack GetRackById(int id)
        {
            Rack Rack = rackRepository.GetById(id);

            return(Rack);
        }
Beispiel #39
0
 public void Delete(Rack obj)
 {
     throw new System.NotImplementedException();
 }
Beispiel #40
0
 public void Add(Rack rack)
 {
     rackRepository.Add(rack);
 }