Ejemplo n.º 1
0
        public ActionResult Results()
        {
            Rocker newRock   = new Rocker(Request.Form["inputOne"]);
            Random newRandom = new Random();

            return(View(newRock));
        }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        rocker = GameObject.FindGameObjectWithTag("Rocker").GetComponent <Rocker>();

        moveForwardX     = (int)MoveState.right;
        lastMoveForwardX = moveForwardX;

        moveForwardY     = (int)MoveStateY.up;
        lastMoveForwardY = moveForwardY;

        lastEnerge = energy;
        maxEnerge  = energy;

        originOperability = operability;

        switch (forward)
        {
        case 0:
        case 1:
            startFactor = new Vector2(2.8f, 1);
            break;

        case 2:
        case 3:
            startFactor = new Vector2(1, 2.8f);
            break;
        }
    }
Ejemplo n.º 3
0
        public SystemRealTimeStatus(SystemIntegration system)
        {
            In = new PumpRealTimeStatus()
            {
                DeviceId  = system.PumpIn.DeviceId,
                IsEnabled = system.PumpIn.IsEnabled,
                Icon      = system.PumpIn.Icon,
                Name      = system.PumpIn.Name,
                Device    = system.PumpIn
            };

            Out = new PumpRealTimeStatus()
            {
                DeviceId  = system.PumpOut.DeviceId,
                IsEnabled = system.PumpOut.IsEnabled,
                Icon      = system.PumpOut.Icon,
                Name      = system.PumpOut.Name,
                Device    = system.PumpOut
            };

            Rocker = new Rocker()
            {
                DeviceId  = system.Rocker.DeviceId,
                IsEnabled = system.Rocker.IsEnabled,
                Icon      = system.Rocker.Icon,
                Name      = system.Rocker.Name,
            };
            Temperature = new TemperatureGauge()
            {
                DeviceId  = system.TemperatureGauge.DeviceId,
                IsEnabled = system.TemperatureGauge.IsEnabled,
                Icon      = system.TemperatureGauge.Icon,
                Name      = system.TemperatureGauge.Name,
            };
            Gas = new Gas()
            {
                DeviceId  = system.Gas.DeviceId,
                IsEnabled = system.Gas.IsEnabled,
                Icon      = system.Gas.Icon,
                Name      = system.Gas.Name,
            };
            Ph = new PhDevice()
            {
                DeviceId  = system.Ph.DeviceId,
                IsEnabled = system.Ph.IsEnabled,
                Icon      = system.Ph.Icon,
                Name      = system.Ph.Name,
            };
            Do = new DoDevice()
            {
                DeviceId  = system.Do.DeviceId,
                IsEnabled = system.Do.IsEnabled,
                Icon      = system.Do.Icon,
                Name      = system.Do.Name,
            };
        }
Ejemplo n.º 4
0
 //列表会用于修改页面,必须防止其他线程更改该列表的值
 public IList <BaseDevice> GetDevices()
 {
     return(new List <BaseDevice>()
     {
         In.CloneProperties(),
         Out.CloneProperties(),
         Temperature.CloneProperties(),
         Rocker.CloneProperties(),
         Gas.CloneProperties(),
         Ph.CloneProperties(),
         Do.CloneProperties()
     });
 }
Ejemplo n.º 5
0
        public void Player1Wins()
        {
            // Arrange
            Rocker newRock = new Rocker("paper", "rock");

            var output = "P1 Wins";

            // Act
            string result = newRock.CompareValue();

            // Assert
            Assert.AreEqual(result, output);
            //Assert.AreEqual(result, "DRAW"); this will return the same thing as above
        }
Ejemplo n.º 6
0
        public static SystemIntegration GetDefaultCultivation()
        {
            var pumpIn = new Pump()
            {
                DeviceId        = Config.Pump1Id,
                Name            = Config.Pump1Name,
                StartTime       = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")),
                EndTime         = DateTime.Now.AddDays(10),
                Direction       = DirectionEnum.Anticlockwise,
                InOrOut         = PumpInOrOut.In,
                InitialVolume   = 10.0D,
                InitialFlowRate = 10.0D,
                IsEnabled       = true,
                Icon            = "/Assets/Filters/Products/Automation.png",
                ProcessMode     = ProcessModeEnum.SingleMode
            };

            var pumpOut = new Pump()
            {
                DeviceId        = Config.Pump3Id,
                Name            = Config.Pump3Name,
                StartTime       = DateTime.Parse(DateTime.Now.AddMinutes(1).ToString("yyyy-MM-dd HH:mm:ss")),
                EndTime         = DateTime.Now.AddDays(10),
                Direction       = DirectionEnum.Clockwise,
                InOrOut         = PumpInOrOut.Out,
                InitialVolume   = 10,
                InitialFlowRate = 10,
                IsEnabled       = true,
                Icon            = "/Assets/Filters/Products/Automation.png",
                ProcessMode     = ProcessModeEnum.SingleMode
            };
            var tempe = new TemperatureGauge()
            {
                DeviceId    = Config.TemperatureId,
                IsEnabled   = true,
                Temperature = 38.0D,
                Icon        = "/Assets/Filters/Products/Automation.png",
                Name        = "Temperature"
            };
            var rocker = new Rocker()
            {
                DeviceId  = Config.RockerId,
                Angle     = Config.DefaultAngle,
                Speed     = Config.DefaultSpeed,
                IsEnabled = true,
                Icon      = "/Assets/Filters/Products/Automation.png",
                Name      = "Rocker"
            };
            var gas = new Gas()
            {
                DeviceId      = Config.GasId,
                Concentration = 5.0D,
                FlowRate      = 400.0D,
                IsEnabled     = true,
                Icon          = "/Assets/Filters/Products/Automation.png",
                Name          = "Gas"
            };
            var ph = new PhDevice()
            {
                Icon     = "/Assets/Filters/Products/Automation.png",
                DeviceId = Config.PhId, PH = 7.0, IsEnabled = true, Name = "Ph"
            };
            var xdo = new DoDevice()
            {
                DeviceId = Config.DoId, DO = 1.0D, IsEnabled = true, Name = "Do",
                Icon     = "/Assets/Filters/Products/Automation.png"
            };

            return(new SystemIntegration
            {
                TemperatureGauge = tempe,
                Rocker = rocker,
                Gas = gas,
                PumpIn = pumpIn,
                PumpOut = pumpOut,
                Ph = ph,
                Do = xdo,
                CellCultivation = new CellCultivation()
                {
                    Description = "",
                    Name = $"date{DateTime.Now:yyyyMMddHHmmss}",
                    UserName = "",
                    Cell = ""
                }
            });
        }
Ejemplo n.º 7
0
 public RockerController(ControlCenter center, RockerDevice device, Rocker rocker) : base(center, device)
 {
     Rocker = rocker;
 }
Ejemplo n.º 8
0
        public ActionResult Results()
        {
            Rocker newRock = new Rocker(Request.Form["inputOne"], Request.Form["inputTwo"]);

            return(View(newRock));
        }
Ejemplo n.º 9
0
 public Rocker Post([FromBody] Rocker rocker)
 {
     _context.Rockers.Add(rocker);
     _context.SaveChanges();
     return(rocker);
 }