Beispiel #1
0
        private int GetLoopStep(int iterationNumber)
        {
            int retval = 0;

            retval = (iterationNumber - DelayInstructionSet.Count()) % InstructionSet.Count();
            return(retval);
        }
Beispiel #2
0
        public ushort GetCurrentLevel(int iterationNumber, bool Translated)
        {
            ushort retval;
            int    loopStep;

            if (DelayInstructionSet.Count == 0)
            {
                CompletedInitialWait = true;
            }


            if (!Translated)
            {
                if (!CompletedInitialWait)
                {
                    retval = DelayInstructionSet[iterationNumber - 1];
                    if (iterationNumber == DelayInstructionSet.Count())
                    {
                        CompletedInitialWait = true;
                    }
                }
                else
                {
                    loopStep = GetLoopStep(iterationNumber);
                    retval   = InstructionSet[loopStep];
                }
            }
            else
            {
                if (!CompletedInitialWait)
                {
                    retval = Convert.ToUInt16(TranslatedDelayInstructionSet[iterationNumber - 1]);
                    if (iterationNumber == TranslatedDelayInstructionSet.Count())
                    {
                        CompletedInitialWait = true;
                    }
                }
                else
                {
                    loopStep = GetLoopStep(iterationNumber);
                    retval   = Convert.ToUInt16(TranslatedInstructionSet[loopStep]);
                }
            }
            //  LocalStep++;
            return(retval);
        }