Beispiel #1
0
        /// <summary>
        /// 信号灯1绿灯
        /// </summary>
        public void GreenLight1()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("信号灯1绿灯");
#endif
            this.Iocer.Output(commonDAO.GetAppletConfigInt32("IO控制器_信号灯1端口"), true);
            Thread.Sleep(500);

            commonDAO.SetSignalDataValue(commonAppConfig.AppIdentifier, "信号灯1", "0");
        }
Beispiel #2
0
        /// <summary>
        /// 信号灯2红灯
        /// </summary>
        public void RedLight2()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("信号灯2红灯");
#endif
            this.Iocer.Output(commonDAO.GetAppletConfigInt32("IO控制器_信号灯2端口"), false);
            Thread.Sleep(500);

            commonDAO.SetSignalDataValue(CommonAppConfig.GetInstance().AppIdentifier, "信号灯2", "1");
        }
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void InitForm()
        {
            FrmDebugConsole.GetInstance();

            // 采样机设备编码
            this.SamplerMachineCode = commonDAO.GetAppletConfigString("采样机设备编码");
            this.SamplerMachineName = commonDAO.GetMachineNameByCode(this.SamplerMachineCode);

            // 默认自动
            sbtnChangeAutoHandMode.Value = true;
        }
Beispiel #4
0
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void InitForm()
        {
            FrmDebugConsole.GetInstance();

            // 默认自动
            sbtnChangeAutoHandMode.Value = true;

            // 重置程序远程控制命令
            commonDAO.ResetAppRemoteControlCmd(CommonAppConfig.GetInstance().AppIdentifier);

            btnRefresh_Click(null, null);
        }
Beispiel #5
0
        /// <summary>
        /// 道闸2降杆
        /// </summary>
        public void Gate2Down()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("道闸2降杆");
#endif
            int port = commonDAO.GetAppletConfigInt32("IO控制器_道闸2降杆端口");

            this.Iocer.Output(port, true);
            Thread.Sleep(100);
            this.Iocer.Output(port, false);
            Thread.Sleep(500);

            commonDAO.SetSignalDataValue(commonAppConfig.AppIdentifier, "道闸2升杆", "0");
        }
Beispiel #6
0
        /// <summary>
        /// 道闸2升杆
        /// </summary>
        public void Gate2Up()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("道闸2升杆");
#endif
            int port = commonDAO.GetAppletConfigInt32("IO控制器_道闸2升杆端口");

            this.Iocer.Output(port, true);
            Thread.Sleep(100);
            this.Iocer.Output(port, false);
            Thread.Sleep(500);

            commonDAO.SetSignalDataValue(CommonAppConfig.GetInstance().AppIdentifier, eSignalDataName.道闸2升杆.ToString(), "1");
        }
        /// <summary>
        /// 窗体初始化
        /// </summary>
        private void InitForm()
        {
            FrmDebugConsole.GetInstance();

            // 采样机设备编码
            this.SamplerMachineCode = commonDAO.GetAppletConfigString("采样机设备编码");
            this.SamplerMachineName = commonDAO.GetMachineNameByCode(this.SamplerMachineCode);

            // 默认自动
            sbtnChangeAutoHandMode.Value = true;

            // 重置程序远程控制命令
            commonDAO.ResetAppRemoteControlCmd(CommonAppConfig.GetInstance().AppIdentifier);

            btnRefresh_Click(null, null);
        }
        /// <summary>
        /// 道闸1降杆
        /// </summary>
        public void Gate1Down()
        {
#if DEBUG
            FrmDebugConsole.GetInstance().Output("道闸1降杆");
#endif
            if (commonDAO.GetAppletConfigString("启用道闸1") != "1")
            {
                return;
            }
            int port = commonDAO.GetAppletConfigInt32("IO控制器_道闸1降杆端口");

            this.Iocer.Output(port, true);
            Thread.Sleep(100);
            this.Iocer.Output(port, false);
            Thread.Sleep(500);

            commonDAO.SetSignalDataValue(CommonAppConfig.GetInstance().AppIdentifier, "道闸1升杆", "0");
        }
Beispiel #9
0
        /// <summary>
        /// 读卡、车号识别任务
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void timer1_Tick(object sender, EventArgs e)
        {
            timer1.Stop();
            timer1.Interval = 500;

            try
            {
                // 执行远程命令
                ExecAppRemoteControlCmd();

                switch (this.CurrentFlowFlag)
                {
                case eFlowFlag.等待车辆:
                    #region

                    //提高灵敏度
                    timer1.Interval = 1000;

                    List <string> tags = Hardwarer.Rwer1.ScanTags();
                    if (tags.Count > 0)
                    {
                        passCarQueuer.Enqueue(ePassWay.Way1, tags[0], true);
                        FrmDebugConsole.GetInstance().Output("识别到卡号:" + tags[0]);
                    }
                    if (passCarQueuer.Count > 0)
                    {
                        this.CurrentFlowFlag = eFlowFlag.识别车辆;
                    }

                    #endregion
                    break;

                case eFlowFlag.识别车辆:
                    #region

                    // 队列中无车时,等待车辆
                    if (passCarQueuer.Count == 0)
                    {
                        this.CurrentFlowFlag = eFlowFlag.等待车辆;
                        break;
                    }

                    this.CurrentImperfectCar = passCarQueuer.Dequeue();

                    // 方式一:根据识别的车牌号查找车辆信息
                    this.CurrentAutotruck = carTransportDAO.GetAutotruckByCarNumber(this.CurrentImperfectCar.Voucher);

                    if (this.CurrentAutotruck == null)
                    {
                        // 方式二:根据识别的标签卡查找车辆信息
                        this.CurrentAutotruck = carTransportDAO.GetAutotruckByTagId(this.CurrentImperfectCar.Voucher);
                    }

                    if (this.CurrentAutotruck != null)
                    {
                        if (this.CurrentAutotruck.IsUse == 1)
                        {
                            if (this.CurrentAutotruck.CarType == eCarType.入厂煤.ToString())
                            {
                                this.timer_BuyFuel_Cancel = false;
                                this.CurrentFlowFlag      = eFlowFlag.验证信息;
                            }
                            else if (this.CurrentAutotruck.CarType == eCarType.其他物资.ToString())
                            {
                                this.timer_Goods_Cancel = false;
                                this.CurrentFlowFlag    = eFlowFlag.验证信息;
                            }
                        }
                        else
                        {
                            this.voiceSpeaker.Speak("车牌号 " + this.CurrentAutotruck.CarNumber + " 已停用,禁止通过", 1, false);
                            this.CurrentFlowFlag     = eFlowFlag.等待车辆;
                            this.CurrentAutotruck    = null;
                            this.CurrentImperfectCar = null;
                            timer1.Interval          = 20000;
                        }
                    }
                    else
                    {
                        //// 方式一:车号识别
                        //this.voiceSpeaker.Speak("车牌号 " + this.CurrentImperfectCar.Voucher + " 未登记,禁止通过", 1, false);
                        // 方式二:刷卡方式
                        this.voiceSpeaker.Speak("卡号未登记,禁止通过", 1, false);
                        this.CurrentFlowFlag     = eFlowFlag.等待车辆;
                        this.CurrentAutotruck    = null;
                        this.CurrentImperfectCar = null;
                        timer1.Interval          = 20000;
                    }

                    #endregion
                    break;
                }
            }
            catch (Exception ex)
            {
                Log4Neter.Error("timer1_Tick", ex);
            }
            finally
            {
                timer1.Start();
            }
        }