Example #1
0
        protected override int StateCheckResponse(int s, out bool error, out object outobj)
        {
            int           iRes  = -1;
            StatesMachine state = (StatesMachine)s;

            error  = true;
            outobj = null;

            ItemQueue itemQueue = null;

            try
            {
                switch (state)
                {
                    #region LIST_GROUP_SOURCES
                case (int)StatesMachine.LIST_GROUP_SOURCES:
                    error  = false;
                    outobj = new object [] {
                        m_fileINI.ListSrcGroupSources
                        , m_fileINI.ListDestGroupSources
                    };

                    iRes = 0;
                    break;
                    #endregion

                    #region LIST_GROUP_SIGNALS
                case StatesMachine.LIST_GROUP_SIGNALS:
                    error  = false;
                    outobj = new object[] {
                        m_fileINI.ListSrcGroupSignals
                        , m_fileINI.ListDestGroupSignals
                    };

                    iRes = 0;
                    break;
                    #endregion

                    #region LIST_SRC_GROUP_SOURCE_ITEMS, LIST_SRC_GROUP_SOURCE_PARS, LIST_SRC_GROUP_SOURCE_PROP, LIST_SRC_GROUP_SIGNAL_ITEMS, LIST_SRC_GROUP_SIGNAL_PARS, LIST_SRC_GROUP_SIGNAL_PROP
                case StatesMachine.LIST_SRC_GROUP_SOURCE_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    =
                        //m_fileINI.GetListItemsOfGroupSource(itemQueue.Pars.ToArray())
                        m_fileINI.GetListItemsOfGroupSource(itemQueue.Pars.ToArray())
                    ;

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SOURCE_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SOURCE_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SIGNAL_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SIGNAL_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SIGNAL_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;
                    #endregion

                    #region LIST_DEST_GROUP_SOURCE_ITEMS, LIST_DEST_GROUP_SOURCE_PARS, LIST_DEST_GROUP_SOURCE_PROP, LIST_DEST_GROUP_SIGNAL_ITEMS, LIST_DEST_GROUP_SIGNAL_PARS, LIST_DEST_GROUP_SIGNAL_PROP
                case StatesMachine.LIST_DEST_GROUP_SOURCE_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemsOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SOURCE_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SOURCE_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SIGNAL_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SIGNAL_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SIGNAL_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;
                    #endregion

                    #region OBJ_SRC_GROUP_SOURCES, OBJ_DEST_GROUP_SOURCES
                case StatesMachine.OBJ_SRC_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр строковый идентификатор "выбранноой" группы источников
                    outobj = m_fileINI.GetObjectSrcGroupSources((string)itemQueue.Pars[0]);

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_DEST_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр индекс "выбранноой" группы источников
                    outobj = m_fileINI.GetObjectDestGroupSources((string)itemQueue.Pars[0]);

                    iRes = 0;
                    break;
                    #endregion

                    #region TIMER_WORK_UPDATE
                case StatesMachine.TIMER_WORK_UPDATE:
                    error  = false;
                    outobj = m_fileINI.SecondWorkUpdate;

                    iRes = 0;
                    break;
                    #endregion

                    #region OBJ_SRC_GROUP_SIGNALS_PARS, OBJ_SRC_GROUP_SIGNALS, OBJ_DEST_GROUP_SIGNALS_PARS, OBJ_DEST_GROUP_SIGNALS
                case StatesMachine.OBJ_SRC_GROUP_SIGNALS_PARS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignalsPars(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_SRC_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignals(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_DEST_GROUP_SIGNALS_PARS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignalsPars(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_DEST_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignals(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;
                    #endregion

                    #region STATE_GROUP_SOURCES, STATE_GROUP_SIGNALS
                case StatesMachine.STATE_GROUP_SOURCES:
                    error  = false;
                    outobj = new object[(int)INDEX_SRC.COUNT_INDEX_SRC];
                    for (INDEX_SRC indxSrc = INDEX_SRC.SOURCE; indxSrc < INDEX_SRC.COUNT_INDEX_SRC; indxSrc++)
                    {
                        (outobj as object[])[(int)indxSrc] = new GroupSources.STATE[m_listGroupSources[(int)indxSrc].Count];

                        foreach (GroupSources grpSrc in m_listGroupSources[(int)indxSrc])
                        {
                            ((outobj as object[])[(int)indxSrc] as GroupSources.STATE[])[m_listGroupSources[(int)indxSrc].IndexOf(grpSrc)] = grpSrc.State;
                        }
                    }

                    iRes = 0;
                    break;

                case StatesMachine.STATE_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр индекс "выбранноой" группы сигналов
                    outobj = new object[(int)INDEX_SRC.COUNT_INDEX_SRC];
                    for (INDEX_SRC indxSrc = INDEX_SRC.SOURCE; indxSrc < INDEX_SRC.COUNT_INDEX_SRC; indxSrc++)
                    {
                        if (!((int)itemQueue.Pars[(int)indxSrc] < 0))
                        {
                            (outobj as object[])[(int)indxSrc] = m_listGroupSources[(int)indxSrc][(int)itemQueue.Pars[(int)indxSrc]].GetArgGroupSignals();
                        }
                        else
                        {
                            (outobj as object[])[(int)indxSrc] = new object [] { }
                        }
                    }
                    ;

                    iRes = 0;
                    break;
                    #endregion

                    #region STATE_CHANGED_GROUP_SOURCES, STATE_CHANGED_GROUP_SIGNALS
                case StatesMachine.STATE_CHANGED_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;

                    iRes = m_listGroupSources[(int)((INDEX_SRC)itemQueue.Pars[0])][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].StateChange();
                    break;

                case StatesMachine.STATE_CHANGED_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;

                    iRes = m_listGroupSources[(int)((INDEX_SRC)itemQueue.Pars[0])][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].StateChange((string)itemQueue.Pars[2]);
                    break;
                    #endregion

                    #region COMMAND_RELAOD_GROUP_SOURCES
                case StatesMachine.COMMAND_RELAOD_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;

                    iRes = m_listGroupSources[(int)((INDEX_SRC)itemQueue.Pars[0])][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].Reload();
                    break;
                    #endregion

                    #region CLEARVALUES_DEST_GROUP_SIGNALS
                case StatesMachine.CLEARVALUES_DEST_GROUP_SIGNALS:
                    //[1] - идентификаторы
                    //[2] = дата/время / продолжительность
                    error     = false;
                    itemQueue = Peek;

                    int idGrpSrc         = FormMain.FileINI.GetIDIndex((string)(itemQueue.Pars[1] as object [])[0])
                    , idGrpSgnls         = FormMain.FileINI.GetIDIndex((string)(itemQueue.Pars[1] as object[])[1]);
                    DateTime dtStartDate = (DateTime)(itemQueue.Pars[2] as object[])[0];
                    TimeSpan tsStartTime = (TimeSpan)(itemQueue.Pars[2] as object[])[1]
                    , tsPeriodMain       = (TimeSpan)(itemQueue.Pars[2] as object[])[2];

                    iRes = 0;
                    break;
                    #endregion

                    #region DATA_SRC_GROUP_SIGNALS, DATA_DEST_GROUP_SIGNALS
                case StatesMachine.DATA_SRC_GROUP_SIGNALS:
                case StatesMachine.DATA_DEST_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;

                    INDEX_SRC indxGroupSrc = state == StatesMachine.DATA_SRC_GROUP_SIGNALS ? INDEX_SRC.SOURCE :
                                             state == StatesMachine.DATA_DEST_GROUP_SIGNALS ? INDEX_SRC.DEST :
                                             INDEX_SRC.COUNT_INDEX_SRC;
                    //??? зачем проверка индекса группы источников, как это значение м.б. отрицательным (в элементе управления не выделена ни одна строка!!!)
                    // см. 'PanelWork::fTimerUpdate ()' - из-за того, что при старте /minimize элемент управления не отображается и в нем не назначается выделенная строка
                    if (!((int)itemQueue.Pars[0] < 0))
                    {
                        outobj = m_listGroupSources[(int)indxGroupSrc][(int)itemQueue.Pars[0]].GetDataToPanel(itemQueue.Pars[1] as string, out error);
                    }
                    else
                    {
                        ;
                    }

                    iRes = 0;
                    break;
                    #endregion

                    #region SET_IDCUR_SOURCE_OF_GROUP, SET_TEXT_ADDING, SET_GROUP_SIGNALS_PARS
                case StatesMachine.SET_IDCUR_SOURCE_OF_GROUP:
                    error     = false;
                    itemQueue = Peek;

                    m_listGroupSources[(int)itemQueue.Pars[0]][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].m_IDCurrentConnSett = (string)itemQueue.Pars[2];
                    m_fileINI.UpdateParameter((int)itemQueue.Pars[0], (string)itemQueue.Pars[1], @"SCUR", (string)itemQueue.Pars[2]);

                    iRes = 0;
                    break;

                case StatesMachine.SET_TEXT_ADDING:
                    error     = false;
                    itemQueue = Peek;

                    (m_listGroupSources[(int)itemQueue.Pars[0]][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])] as GroupSources).SetAdding(((string)itemQueue.Pars[2]).Split(new char[] { FileINI.s_chSecDelimeters[(int)FileINI.INDEX_DELIMETER.PAIR_VAL] }));
                    m_fileINI.UpdateParameter((int)itemQueue.Pars[0], (string)itemQueue.Pars[1], @"ADDING", (string)itemQueue.Pars[2]);

                    iRes = 0;
                    break;

                case StatesMachine.SET_GROUP_SIGNALS_PARS:
                    error     = false;
                    itemQueue = Peek;

                    int          indxGroupSgnls = -1;
                    GroupSources grpSrcs        = (m_listGroupSources[(int)itemQueue.Pars[0]][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])] as GroupSources);
                    indxGroupSgnls = grpSrcs.SetGroupSignalsPars(/*(string)itemQueue.Pars[2],*/ itemQueue.Pars[2] as GROUP_SIGNALS_PARS);
                    //indxGroupSgnls = grpSrcs.getIndexGroupSignalsPars((string)itemQueue.Pars[2]);
                    m_fileINI.UpdateParameter((int)itemQueue.Pars[0], (string)itemQueue.Pars[1], indxGroupSgnls, itemQueue.Pars[2] as GROUP_SIGNALS_PARS);

                    iRes = 0;
                    break;
                    #endregion

                    #region GET_GROUP_SIGNALS_DATETIME_PARS
                case StatesMachine.GET_GROUP_SIGNALS_DATETIME_PARS:
                    error     = false;
                    itemQueue = Peek;

                    GROUP_SIGNALS_SRC_PARS grpSgnlsPars = m_listGroupSources[(int)INDEX_SRC.SOURCE][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].GetGroupSignalsPars((string)itemQueue.Pars[2]);
                    outobj = grpSgnlsPars.m_arWorkIntervals[(int)itemQueue.Pars[3]];

                    iRes = 0;
                    break;
                    #endregion

                    #region GET_INTERACTION_PARAMETERS
                case StatesMachine.GET_INTERACTION_PARAMETERS:
                    error     = false;
                    itemQueue = Peek;

                    outobj = m_fileINI.m_InteractionPars;

                    iRes = 0;
                    break;
                    #endregion

                    #region INTERACTION_EVENT
                case StatesMachine.INTERACTION_EVENT:
                    error     = false;
                    itemQueue = Peek;

                    if (itemQueue.Pars.Length > 1)
                    {
                        EventInteraction(new object [] { itemQueue.Pars[0], itemQueue.Pars[1] });
                    }
                    else
                    {
                        EventInteraction(new object[] { itemQueue.Pars[0] });
                    }

                    iRes = 0;
                    break;
                    #endregion

#if _STATE_MANAGER
                    #region OMANAGEMENT_ADD, OMANAGEMENT_REMOVE, OMANAGEMENT_CONFIRM, OMANAGEMENT_UPDATE, OMANAGEMENT_CONTROL
                case StatesMachine.OMANAGEMENT_ADD:
                    iRes  = 0;
                    error = false;

                    itemQueue = Peek;

                    add((ID)itemQueue.Pars[0], (TimeSpan)itemQueue.Pars[1]);
                    break;

                case StatesMachine.OMANAGEMENT_REMOVE:
                    iRes  = 0;
                    error = false;

                    itemQueue = Peek;

                    remove((ID)itemQueue.Pars[0]);
                    break;

                case StatesMachine.OMANAGEMENT_CONFIRM:
                    iRes  = 0;
                    error = false;

                    itemQueue = Peek;

                    confirm((ID)itemQueue.Pars[0]);
                    break;

                case StatesMachine.OMANAGEMENT_UPDATE:
                    iRes  = 0;
                    error = false;

                    itemQueue = Peek;

                    update((ID)itemQueue.Pars[0]);
                    break;

                case StatesMachine.OMANAGEMENT_CONTROL:
                    iRes  = 0;
                    error = false;

                    targetFunc();
                    break;

                    #endregion
#endif
                default:
                    break;
                }
            }
            catch (Exception e)
            {
                Logging.Logg().Exception(e, @"HHandlerQueue::StateCheckResponse (state=" + state.ToString() + @") - ...", Logging.INDEX_MESSAGE.NOT_SET);

                error = true;
                iRes  = -1 * (int)state;
            }

            return(iRes);
        }
Example #2
0
        protected override int StateCheckResponse(int s, out bool error, out object outobj)
        {
            int           iRes  = -1;
            StatesMachine state = (StatesMachine)s;

            error  = true;
            outobj = null;

            ItemQueue itemQueue = null;

            try
            {
                switch (state)
                {
                case (int)StatesMachine.LIST_GROUP_SOURCES:
                    error  = false;
                    outobj = new object [] {
                        m_fileINI.ListSrcGroupSources
                        , m_fileINI.ListDestGroupSources
                    };

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SOURCE_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    =
                        //m_fileINI.GetListItemsOfGroupSource(itemQueue.Pars.ToArray())
                        m_fileINI.GetListItemsOfGroupSource(itemQueue.Pars.ToArray())
                    ;

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SOURCE_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SOURCE_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_GROUP_SIGNALS:
                    error  = false;
                    outobj = new object[] {
                        m_fileINI.ListSrcGroupSignals
                        , m_fileINI.ListDestGroupSignals
                    };

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SIGNAL_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SIGNAL_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_SRC_GROUP_SIGNAL_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SOURCE_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemsOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SOURCE_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SOURCE_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSource(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SIGNAL_ITEMS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SIGNAL_PARS:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListParsOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.LIST_DEST_GROUP_SIGNAL_PROP:
                    error     = false;
                    itemQueue = Peek;
                    outobj    = m_fileINI.GetListItemPropOfGroupSignal(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_SRC_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр строковый идентификатор "выбранноой" группы источников
                    outobj = m_fileINI.GetObjectSrcGroupSources((string)itemQueue.Pars[0]);

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_DEST_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр индекс "выбранноой" группы источников
                    outobj = m_fileINI.GetObjectDestGroupSources((string)itemQueue.Pars[0]);

                    iRes = 0;
                    break;

                case StatesMachine.TIMER_WORK_UPDATE:
                    error  = false;
                    outobj = m_fileINI.SecondWorkUpdate;

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_SRC_GROUP_SIGNALS_PARS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignalsPars(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_SRC_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignals(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_DEST_GROUP_SIGNALS_PARS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignalsPars(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.OBJ_DEST_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр идентификатор "выбранноой" группы сигналов
                    outobj = m_fileINI.GetObjectGroupSignals(itemQueue.Pars.ToArray());

                    iRes = 0;
                    break;

                case StatesMachine.STATE_GROUP_SOURCES:
                    error  = false;
                    outobj = new object[(int)INDEX_SRC.COUNT_INDEX_SRC];
                    for (INDEX_SRC indxSrc = INDEX_SRC.SOURCE; indxSrc < INDEX_SRC.COUNT_INDEX_SRC; indxSrc++)
                    {
                        (outobj as object[])[(int)indxSrc] = new GroupSources.STATE[m_listGroupSources[(int)indxSrc].Count];

                        foreach (GroupSources grpSrc in m_listGroupSources[(int)indxSrc])
                        {
                            ((outobj as object[])[(int)indxSrc] as GroupSources.STATE[])[m_listGroupSources[(int)indxSrc].IndexOf(grpSrc)] = grpSrc.State;
                        }
                    }

                    iRes = 0;
                    break;

                case StatesMachine.STATE_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;
                    //??? 0-й параметр индекс "выбранноой" группы сигналов
                    outobj = new object[(int)INDEX_SRC.COUNT_INDEX_SRC];
                    for (INDEX_SRC indxSrc = INDEX_SRC.SOURCE; indxSrc < INDEX_SRC.COUNT_INDEX_SRC; indxSrc++)
                    {
                        if (!((int)itemQueue.Pars[(int)indxSrc] < 0))
                        {
                            (outobj as object[])[(int)indxSrc] = m_listGroupSources[(int)indxSrc][(int)itemQueue.Pars[(int)indxSrc]].GetArgGroupSignals();
                        }
                        else
                        {
                            (outobj as object[])[(int)indxSrc] = new object [] { }
                        }
                    }
                    ;

                    iRes = 0;
                    break;

                case StatesMachine.STATE_CHANGED_GROUP_SOURCES:
                    error     = false;
                    itemQueue = Peek;

                    iRes = m_listGroupSources[(int)((INDEX_SRC)itemQueue.Pars[0])][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].StateChange();
                    break;

                case StatesMachine.STATE_CHANGED_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;

                    iRes = m_listGroupSources[(int)((INDEX_SRC)itemQueue.Pars[0])][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].StateChange((string)itemQueue.Pars[2]);
                    break;

                case StatesMachine.CLEARVALUES_DEST_GROUP_SIGNALS:
                    //[1] - идентификаторы
                    //[2] = дата/время / продолжительность
                    error     = false;
                    itemQueue = Peek;

                    int idGrpSrc         = FormMain.FileINI.GetIDIndex((string)(itemQueue.Pars[1] as object [])[0])
                    , idGrpSgnls         = FormMain.FileINI.GetIDIndex((string)(itemQueue.Pars[1] as object[])[1]);
                    DateTime dtStartDate = (DateTime)(itemQueue.Pars[2] as object[])[0];
                    TimeSpan tsStartTime = (TimeSpan)(itemQueue.Pars[2] as object[])[1]
                    , tsPeriodMain       = (TimeSpan)(itemQueue.Pars[2] as object[])[2];

                    iRes = 0;
                    break;

                case StatesMachine.DATA_SRC_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;

                    outobj = m_listGroupSources[(int)INDEX_SRC.SOURCE][(int)itemQueue.Pars[0]].GetDataToPanel(itemQueue.Pars[1] as string, out error);

                    iRes = 0;
                    break;

                case StatesMachine.DATA_DEST_GROUP_SIGNALS:
                    error     = false;
                    itemQueue = Peek;

                    if (!((int)itemQueue.Pars[0] < 0))
                    {
                        outobj = m_listGroupSources[(int)INDEX_SRC.DEST][(int)itemQueue.Pars[0]].GetDataToPanel(itemQueue.Pars[1] as string, out error);
                    }
                    else
                    {
                        ;
                    }

                    iRes = 0;
                    break;

                case StatesMachine.SET_IDCUR_SOURCE_OF_GROUP:
                    error     = false;
                    itemQueue = Peek;

                    m_listGroupSources[(int)itemQueue.Pars[0]][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].m_IDCurrentConnSett = (string)itemQueue.Pars[2];
                    m_fileINI.UpdateParameter((int)itemQueue.Pars[0], (string)itemQueue.Pars[1], @"SCUR", (string)itemQueue.Pars[2]);

                    iRes = 0;
                    break;

                case StatesMachine.SET_TEXT_ADDING:
                    error     = false;
                    itemQueue = Peek;

                    (m_listGroupSources[(int)itemQueue.Pars[0]][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])] as GroupSources).SetAdding(((string)itemQueue.Pars[2]).Split(new char[] { FileINI.s_chSecDelimeters[(int)FileINI.INDEX_DELIMETER.PAIR_VAL] }));
                    m_fileINI.UpdateParameter((int)itemQueue.Pars[0], (string)itemQueue.Pars[1], @"ADDING", (string)itemQueue.Pars[2]);

                    iRes = 0;
                    break;

                case StatesMachine.SET_GROUP_SIGNALS_PARS:
                    error     = false;
                    itemQueue = Peek;

                    int          indxGroupSgnls = -1;
                    GroupSources grpSrcs        = (m_listGroupSources[(int)itemQueue.Pars[0]][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])] as GroupSources);
                    indxGroupSgnls = grpSrcs.SetGroupSignalsPars(/*(string)itemQueue.Pars[2],*/ itemQueue.Pars[2] as GROUP_SIGNALS_PARS);
                    //indxGroupSgnls = grpSrcs.getIndexGroupSignalsPars((string)itemQueue.Pars[2]);
                    m_fileINI.UpdateParameter((int)itemQueue.Pars[0], (string)itemQueue.Pars[1], indxGroupSgnls, itemQueue.Pars[2] as GROUP_SIGNALS_PARS);

                    iRes = 0;
                    break;

                case StatesMachine.GET_GROUP_SIGNALS_DATETIME_PARS:
                    error     = false;
                    itemQueue = Peek;

                    GROUP_SIGNALS_SRC_PARS grpSgnlsPars = m_listGroupSources[(int)INDEX_SRC.SOURCE][FormMain.FileINI.GetIDIndex((string)itemQueue.Pars[1])].GetGroupSignalsPars((string)itemQueue.Pars[2]);
                    outobj = grpSgnlsPars.m_arWorkIntervals[(int)itemQueue.Pars[3]];

                    iRes = 0;
                    break;

                default:
                    break;
                }
            }
            catch (Exception e)
            {
                Logging.Logg().Exception(e, @"HHandlerQueue::StateCheckResponse (state=" + state.ToString() + @") - ...", Logging.INDEX_MESSAGE.NOT_SET);

                error = true;
                iRes  = -1 * (int)state;
            }

            return(iRes);
        }