示例#1
0
        public void Reset(RangeMsg <TlfDestination> msg)
        {
            Debug.Assert(msg.From + msg.Count <= NumDestinations);

            for (int i = 0; i < msg.Count; i++)
            {
                TlfDst dst = _Dst[i + msg.From];
                dst.Reset(msg.Info[i]);

                if (dst.PrevState != dst.State)
                {
                    _NumDstInState[(int)dst.PrevState]--;
                    _NumDstInState[(int)dst.State]++;

                    Debug.Assert(_NumDstInState[(int)dst.PrevState] >= 0);
                    Debug.Assert(_NumDstInState[(int)dst.State] >= 0);

                    _Priority.CheckTlfStChanged(dst);
                }
            }

            General.SafeLaunchEvent(TlfChanged, this, (RangeMsg)msg);

            if ((_Transfer.State == FunctionState.Ready) &&
                (_NumDstInState[(int)TlfState.Set] + _NumDstInState[(int)TlfState.Conf] != 1))
            {
                _Transfer.State = FunctionState.Idle;
            }
        }
示例#2
0
        public void CheckTlfStChanged(TlfDst dst)
        {
            if (_AssociatePosition == dst.Id)
            {
                Debug.Assert((_State == FunctionState.Ready) || (_State == FunctionState.Executing));

                switch (dst.State)
                {
                //Cambio el case Idle hacer que funcione el caso de desvío de una llamada con prioridad
                //No entiendo para qué servía esto (B. Santamaria)
                case TlfState.Idle:
                    break;

                case TlfState.Unavailable:
                case TlfState.PaPBusy:
                    if (_State == FunctionState.Executing)
                    {
                        // Puede ocurrir que antes realizar la llamada por acceso indirecto
                        // tengamos que colgar una ya existente. De ahí la comprobación
                        _AssociatePosition = -1;
                        State = FunctionState.Error;
                    }
                    break;

                case TlfState.Out:
                    State = FunctionState.Executing;
                    break;

                case TlfState.Congestion:
                case TlfState.OutOfService:
                case TlfState.Busy:
                    _AssociatePosition = -1;
                    State = FunctionState.Error;
                    break;

                default:
                    _AssociatePosition = -1;
                    State = FunctionState.Idle;
                    break;
                }
            }
            else if ((_State == FunctionState.Ready) && (_AssociatePosition >= Tlf.NumDestinations) && (dst.Id < Tlf.NumDestinations))
            {
                // Puede ocurrir que una llamada por acceso indirecto coincida con una tecla de acceso directo
                switch (dst.State)
                {
                case TlfState.Out:
                    _AssociatePosition = dst.Id;
                    State = FunctionState.Executing;
                    break;

                case TlfState.Congestion:
                case TlfState.OutOfService:
                case TlfState.Busy:
                    _AssociatePosition = -1;
                    State = FunctionState.Error;
                    break;
                }
            }
        }
示例#3
0
        public TlfState GetTlfState(int from, int count)
        {
            Debug.Assert(from + count <= NumDestinations + NumIaDestinations);
            TlfState st = TlfState.Idle;

            if ((from == 0) && (count == NumDestinations + NumIaDestinations))
            {
                for (int i = _NumDstInState.Length - 1; i >= 0; i--)
                {
                    if (_NumDstInState[i] > 0)
                    {
                        st = (TlfState)i;
                        break;
                    }
                }
            }
            else
            {
                for (int i = 0; i < count; i++)
                {
                    TlfDst dst = _Dst[i + from];
                    st = (TlfState)Math.Max((int)st, (int)dst.State);
                }
            }

            return(st);
        }
示例#4
0
        private void OnTlfStChanged(object sender)
        {
            TlfDst dst = (TlfDst)sender;

            _NumDstInState[(int)dst.PrevState]--;
            _NumDstInState[(int)dst.State]++;

            General.SafeLaunchEvent(TlfChanged, this, new RangeMsg(dst.Id, 1));
        }
示例#5
0
        public void Reset(RangeMsg <TlfIaDestination> msg)
        {
            Debug.Assert((msg.From >= NumDestinations) && (msg.From + msg.Count <= NumDestinations + NumIaDestinations));

            for (int i = 0; i < msg.Count; i++)
            {
                TlfIaDestination info = msg.Info[i];
                TlfDst           dst  = _Dst[i + msg.From];

                dst.Reset(info);

                // 29112016. JCAM.  Poder intruir una llamada prioritaria desde AI
                if (info.State == TlfState.Idle && IntrudeTo.IsIntrudingTo && IntrudeTo.To == dst.Dst)
                {
                    IntrudeTo.Reset();
                }

                if (dst.PrevState != dst.State)
                {
                    _NumDstInState[(int)dst.PrevState]--;
                    _NumDstInState[(int)dst.State]++;

                    Debug.Assert(_NumDstInState[(int)dst.PrevState] >= 0);
                    Debug.Assert(_NumDstInState[(int)dst.State] >= 0);

                    _Unhang.CheckTlfStChanged(dst);
                    _Priority.CheckTlfStChanged(dst);
                }
            }

            General.SafeLaunchEvent(TlfChanged, this, (RangeMsg)msg);

            if ((_Transfer.State == FunctionState.Ready) &&
                (_NumDstInState[(int)TlfState.Set] + _NumDstInState[(int)TlfState.Conf] != 1))
            {
                _Transfer.State = FunctionState.Idle;
            }
        }
示例#6
0
        public void Reset(RangeMsg <TlfState> msg)
        {
            for (int i = 0; i < msg.Count; i++)
            {
                TlfDst dst = _Dst[i + msg.From];
                dst.Reset(msg.Info[i]);


                if (msg.Info[i] == TlfState.Idle && IntrudeTo.IsIntrudingTo && IntrudeTo.To == dst.Dst)
                {
                    IntrudeTo.Reset();
                }

                if (i + msg.From == IaMappedPosition)
                {
                    _Unhang.CheckTlfStChanged(dst);
                }

                if (dst.PrevState != dst.State)
                {
                    _NumDstInState[(int)dst.PrevState]--;
                    _NumDstInState[(int)dst.State]++;

                    Debug.Assert(_NumDstInState[(int)dst.PrevState] >= 0);
                    Debug.Assert(_NumDstInState[(int)dst.State] >= 0);

                    _Priority.CheckTlfStChanged(dst);
                }
            }

            General.SafeLaunchEvent(TlfChanged, this, (RangeMsg)msg);

            if ((_Transfer.State == FunctionState.Ready) &&
                (_NumDstInState[(int)TlfState.Set] + _NumDstInState[(int)TlfState.Conf] != 1))
            {
                _Transfer.State = FunctionState.Idle;
            }
        }
示例#7
0
        public Tlf()
        {
            for (int i = 0; i < NumDestinations + NumIaDestinations; i++)
            {
                _Dst[i]            = new TlfDst(i);
                _Dst[i].StChanged += OnTlfStChanged;
            }

            if (SoloAltavoces)
            {
                _AltavozTlfEstado = true;
            }
            else if (AltavozTlfHabilitado)
            {
                // Se inicializa con el estado guardado
                _AltavozTlfEstado = Settings.Default.TlfSpeaker;
            }
            else
            {
                _AltavozTlfEstado = false;
            }
            _NumDstInState[(int)TlfState.Idle] = NumDestinations + NumIaDestinations;
        }
示例#8
0
        public void ResetMem(int id)
        {
            Debug.Assert(id < NumDestinations + NumIaDestinations);

            TlfDst dst = _Dst[id];

            dst.ResetMem();

            if (dst.PrevState != dst.State)
            {
                _NumDstInState[(int)dst.PrevState]--;
                _NumDstInState[(int)dst.State]++;

                Debug.Assert(_NumDstInState[(int)dst.PrevState] >= 0);
                Debug.Assert(_NumDstInState[(int)dst.State] >= 0);

                if (id == IaMappedPosition)
                {
                    _Unhang.CheckTlfStChanged(dst);
                }

                General.SafeLaunchEvent(TlfChanged, this, new RangeMsg(id, 1));
            }
        }
示例#9
0
        public void CheckTlfStChanged(TlfDst dst)
        {
            if (_AssociatePosition == dst.Id)
            {
                switch (dst.State)
                {
                case TlfState.Unavailable:
                case TlfState.Idle:
                case TlfState.PaPBusy:
                    if (_State != UnhangState.Idle)
                    {
                        // Puede ocurrir que antes realizar la llamada por acceso indirecto
                        // tengamos que colgar una ya existente. De ahí la comprobación
                        _AssociatePosition = -1;
                        State = UnhangState.Idle;
                    }
                    break;

                case TlfState.Out:
                    State = UnhangState.Out;
                    break;

                case TlfState.Set:
                    State = UnhangState.Set;
                    break;

                case TlfState.Conf:
                    State = UnhangState.Conf;
                    break;

                case TlfState.Busy:
                    State = UnhangState.Busy;
                    break;

                case TlfState.RemoteHold:
                    State = UnhangState.RemoteHold;
                    break;

                case TlfState.Hold:
                    State = UnhangState.Hold;
                    break;

                case TlfState.Congestion:
                    State = UnhangState.Congestion;
                    break;

                case TlfState.OutOfService:
                    State = UnhangState.OutOfService;
                    break;

                case TlfState.NotAllowed:
                    State = UnhangState.NotAllowed;
                    break;

                default:
                    _AssociatePosition = -1;
                    State = UnhangState.Idle;
                    break;
                }
            }
        }