Exemplo n.º 1
0
        private void InitDeviceRevisionResponse(int ResId, int StatusId, int RBWState, int RCWState, string StatusStr)
        {
            try
            {
                Utils.ToLog("InitDeviceRevisionResponse");

                if (ResId != CFCCApi.FCC_SUCCESS)
                {
                    GhangeConnectionState(ConnectonState_DevNotConnect);
                }
                else
                {
                    if (StatusId == CFCCApi.STATUS_CODE_IDLE)
                    {
                        Utils.ToLog("InitDeviceRevisionResponse GhangeConnectionState");
                        GhangeSubstate(GlorySubState_Ok, 0);
                        GhangeConnectionState(ConnectonState_Idle, StatusStr, Colors.Black);
                    }



                    else if (StatusId == CFCCApi.STATUS_CODE_INIT)
                    {
                        if ((RBWState < 1001) && (RCWState < 1001))
                        {
                            GhangeSubstate(GlorySubState_Init, 0);
                        }
                        else
                        {
                            GhangeSubstate(GlorySubState_InitError, 0);
                            if (RBWState > 1000)
                            {
                                SetStatus("Инициализация. Ошибка устройств: " + CFCCApi.GetDiviceStateByCode(RBWState, 1));
                            }
                            else if (RCWState > 1000)
                            {
                                SetStatus("Инициализация. Ошибка устройств: " + CFCCApi.GetDiviceStateByCode(RBWState, 2));
                            }
                        }
                    }

                    else if (StatusId == CFCCApi.STATUS_CODE_DEPOSIT_WAIT)
                    {
                        if (RBWState == 2700) //Ожидает окончания внесения размена
                        {
                            GhangeConnectionState(ConnectonState_StartRepl);
                        }
                        else
                        {
                            GhangeConnectionState(ConnectonState_WaitingInsertionNonRepl, "Устройство приема наличных средств находится в состоянии ожидания внесения денежных сумм.", Colors.Red);
                        }
                    }
                    else if (StatusId == CFCCApi.STATUS_CODE_DEPOSITREMOVWAIT)
                    {
                        GhangeSubstate(GlorySubState_WaitingRemovalReject, 0);
                    }
                    else if (StatusId == CFCCApi.STATUS_CODE_DISPENSEREMOVWAIT)
                    {
                        GhangeSubstate(GlorySubState_WaitingRemovalCashout, StatusId);
                    }
                    else if (StatusId == CFCCApi.STATUS_CODE_UNLOCKING)
                    {
                        cassetaLockState = false;
                        pnlInkassMenu.SetBtnUnlockTxt("Заблокировать кассету");

                        AllDoButtonsDisable();
                        pnlInkassMenu.SetBtnUnlockEnable(true);

                        GhangeSubstate(GlorySubState_Unlocking, 0);
                    }

                    else
                    {
                        GhangeSubstate(GlorySubState_NonDescript, StatusId);
                    }
                    if ((StatusId != CFCCApi.STATUS_CODE_WAITINGINVENTORY) && (StatusId != CFCCApi.STATUS_CODE_INIT))
                    {
                        CFCCApi FCCApi = new CFCCApi();

                        FCCApi.UpdateInventoryAsync(UpdateInventory);
                    }
                }
            }
            catch (Exception e)
            {
                Utils.ToLog("InitDeviceRevisionResponse Error " + e.Message);
            }
        }
Exemplo n.º 2
0
        void FCCApi_OnSetStatus(object sender, bool StatusChange, int status, int DevId, string EventName)
        {
            this.Dispatcher.Invoke((Action)(() =>
            {
                if (StatusChange)
                {
                    if (status == CFCCApi.STATUS_CODE_DISPENSEREMOVWAIT)
                    {
                        ShowProcessMessage("Заберите деньги из лотка.");
                    }
                    else if (status == CFCCApi.STATUS_CODE_DEPOSITREMOVWAIT)
                    {
                        ShowProcessMessage("Заберите непринятые купюры.");
                    }

                    /*
                     * else if (status == FCCApi.STATUS_CODE_WAITINGINVENTORY)
                     * {
                     * NeedInventoryUpdate = true;
                     *
                     * }
                     * */
                    else if (status == CFCCApi.STATUS_CODE_DEPOSIT_WAIT)
                    {
                        HideProcessMessage();
                    }
                    else if (status == CFCCApi.STATUS_CODE_IDLE)
                    {
                        if (NeedInventoryUpdate)
                        {
                            NeedInventoryUpdate = false;
                            CFCCApi FCCApi = new CFCCApi();
                            FCCApi.UpdateInventoryAsync(UpdateInventory);
                        }
                        if (NeedStatusRequest)
                        {
                            FCCApi = new CFCCApi();
                            int StatusRes = FCCApi.GetStatusAsync(InitDeviceRevisionResponse);
                        }
                        //GhangeSubstate(GlorySubState_Ok, 0);
                    }
                    else if (status == CFCCApi.STATUS_CODE_UNLOCKING)
                    {
                        GhangeSubstate(GlorySubState_Unlocking, 0);
                    }
                }

                else
                {
                    if (EventName == "eventCassetteInventoryOnRemoval")
                    {
                        //FCCApi
                    }


                    else if (EventName == "eventCassetteInserted")
                    //else if (EventName == "eventCassetteInventoryOnInsertion")
                    {
                        //FCCApi
                    }
                }
            }));
        }