Пример #1
0
 public GuideLine(GuideDirection direction)
 {
     this.CurrentField = new Models.FieldModel();
     this.direction    = direction;
     Padding           = Padding;
     this.BackColor    = Color.Red;
 }
        private IRestRequest BuildPulseGuideRequest(GuideDirection direction, int duration)
        {
            var parameters = new Dictionary <string, object>
            {
                { TelescopeCommandParameters.Direction, ((int)direction).ToString() },
                { TelescopeCommandParameters.Duration, duration.ToString() }
            };

            return(RequestBuilder.BuildRestRequest(TelescopeCommand.PulseGuide, Method.PUT, parameters, GetClientTransactionId()));
        }
Пример #3
0
        public void PulseGuide(GuideDirection Direction, int Duration)
        {
            Dictionary <string, string> Parameters = new Dictionary <string, string>
            {
                { AlpacaConstants.DIRECTION_PARAMETER_NAME, ((int)Direction).ToString(CultureInfo.InvariantCulture) },
                { AlpacaConstants.DURATION_PARAMETER_NAME, Duration.ToString(CultureInfo.InvariantCulture) }
            };

            DynamicClientDriver.SendToRemoteDevice <NoReturnValue>(clientNumber, client, URIBase, strictCasing, TL, "PulseGuide", Parameters, Method.PUT, MemberTypes.Method);
        }
Пример #4
0
        public void TelescopePulseGuidePutTest()
        {
            // TODO uncomment below to test the method and replace null with proper value
            int            deviceNumber        = 0;
            GuideDirection direction           = GuideDirection.North;
            int            duration            = 1;
            int?           clientID            = 1;
            int?           clientTransactionID = 1;
            var            response            = instance.TelescopePulseGuidePut(deviceNumber, direction, duration, clientID, clientTransactionID);

            Assert.IsType <Response>(response);
        }
Пример #5
0
    public bool Show(GuideDirection direction, bool canShow)
    {
        bool haveEquationNumber = false;

        int pOffsetRow    = direction.OffsetRow;
        int pOffsetColumn = direction.OffsetColumn;

        int currentRow    = _originalRow + pOffsetRow;
        int currentColumn = _originalColumn + pOffsetColumn;

        while (currentRow >= 0 &&
               currentRow < GlobalConfig.RowCount &&
               currentColumn >= 0 &&
               currentColumn < GlobalConfig.ColumnCount)
        {
            GameObject BackgroundCellObj = GlobalConfig.BackgroundObjectCollection[currentRow * GlobalConfig.ColumnCount + currentColumn];
            GameObject numberObj         = BackgroundCellObj.GetComponent <BackgroundCell>().BackgroundCellEntity.NumberObject;
            if (numberObj == null)
            {
                if (canShow)
                {
                    BackgroundCellObj.GetComponent <BackgroundCell>().ShowGuide();
                }
            }
            if (numberObj != null)
            {
                int currentValue = numberObj.GetComponent <NumberCell>().NumberEntity.CurrentNumberValue;
                int moveToValue  = GlobalConfig.BackgroundObjectCollection[_originalRow * GlobalConfig.ColumnCount + _originalColumn].
                                   GetComponent <BackgroundCell>().BackgroundCellEntity.NumberObject.
                                   GetComponent <NumberCell>().NumberEntity.CurrentNumberValue;
                if (currentValue == moveToValue)
                {
                    if (canShow)
                    {
                        BackgroundCellObj.GetComponent <BackgroundCell>().ShowGuide();
                    }
                    haveEquationNumber = true;
                }
                break;
            }
            currentRow    += pOffsetRow;
            currentColumn += pOffsetColumn;
        }
        return(haveEquationNumber);
    }
 /// <inheritdoc/>
 public async Task PulseGuideAsync(GuideDirection direction, int duration) => await ExecuteRequestAsync(BuildPulseGuideRequest, direction, duration);
 /// <inheritdoc/>
 public void PulseGuide(GuideDirection direction, int duration) => ExecuteRequest(BuildPulseGuideRequest, direction, duration);