コード例 #1
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// ②指定扇区命令
 /// </summary>
 private void CmdPointChip()
 {
     Order order = BuildOrderCmdPointChip();
     ComSendData(order.returnCmdBytes);
     OnMsgShowEvent(MsgType.Send, order.returnCmdBytes);
     OnUpgradeCompletedEvent(UpgradeResult.ClearSector);
     currentOrder = order;
     StarTimerCheckReceive();
 }
コード例 #2
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// 运行升级扇区命令
 /// </summary>
 public void CmdRunUpgradeSector()
 {
     Order order = BuildOrderCmdRunUpgradeSector();
     ComSendData(order.returnCmdBytes);
     OnMsgShowEvent(MsgType.Send, order.returnCmdBytes);//界面显示16进制数据
     OnUpgradeCompletedEvent(UpgradeResult.RunUpgradeApp);//状态栏、进度tab显示
     currentOrder = order;
     StarTimerCheckReceive();
 }
コード例 #3
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// ③发送升级数据命令
 /// </summary>
 public void CmdSendUpgradeData(ref int index)
 {
     Order order = listOrder[index++];//此处增了,注意如果回复失败要退回索引
     ComSendData(order.returnCmdBytes);
     OnMsgShowEvent(MsgType.Send, order.returnCmdBytes);	//界面显示16进制数据
     OnUpgradeCompletedEvent(UpgradeResult.WriteData);	//状态栏、进度tab显示
     OnSendUpgradeDataProcessEvent(index);				//进度条更新
     currentOrder = order;
     StarTimerCheckReceive();
 }
コード例 #4
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// 获取版本命令
 /// </summary>
 public void CmdGetVersion()
 {
     isUpgrading = true;
     timerCheckPulse.Start();
     Order order = BuildOrderCmdGetVersion();
     ComSendData(order.returnCmdBytes);
     OnMsgShowEvent(MsgType.Send, order.returnCmdBytes);//界面显示16进制数据
     OnUpgradeCompletedEvent(UpgradeResult.RunFactoryApp);//状态栏、进度tab显示
     currentOrder = order;
     StarTimerCheckReceive();
 }
コード例 #5
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// ①升级前的复位命令
 /// </summary>
 public void CmdReset(bool isHead)
 {
     Order order;
     if (isHead)
     {
         order = BuildOrderCmdReset();
     }
     else
     {
         order = BuildOrderCmdReset(isHead);
     }
     ComSendData(order.returnCmdBytes);
     OnMsgShowEvent(MsgType.Send, order.returnCmdBytes);
     OnUpgradeCompletedEvent(UpgradeResult.Reset);
     currentOrder = order;
     StarTimerCheckReceive();
 }
コード例 #6
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
        public List<Order> BuildOrderCmdSendUpgradeData()
        {
            listOrder.Clear();
            if (listByteReader.Count == 0)
            {
                return null;
            }

            for (int i = 0; i < listByteReader.Count; i++)
            {
                byte[] sendBytes = listByteReader[i];
                Order order = new Order(OrderID.Upgrade);
                order.chipGroup = this.chipGroup;
                order.stationID = StationID;
                order.stationHeadID = StationHeadID;
                order.orderType = OrderType.Data;
                order.ComposeCommandSendUpgradeData(sendBytes);

                listOrder.Add(order);
            }
            return listOrder;
        }
コード例 #7
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
        public Order BuildOrderCmdStopUpgrade()
        {
            Order order = new Order(OrderID.Upgrade);
            order.chipGroup = this.chipGroup;
            order.stationID = StationID;
            order.stationHeadID = StationHeadID;
            order.orderType = OrderType.Completed;
            order.ComposeCommandStopUpgrade();

            return order;
        }
コード例 #8
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
        public Order BuildOrderCmdRunUpgradeSector()
        {
            Order order = new Order(OrderID.Upgrade);
            order.chipGroup = this.chipGroup;
            order.stationID = StationID;
            order.stationHeadID = StationHeadID;
            order.orderType = OrderType.Run;
            order.jumpSector = JumpSector.UpgradeApp;
            order.ComposeCommandRunPointSector();

            return order;
        }
コード例 #9
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// 传输分站复位命令
 /// </summary>
 /// <param name="isHead"></param>
 /// <returns></returns>
 public Order BuildOrderCmdReset(bool isHead)
 {
     Order order = new Order(OrderID.Reset);
     order.stationID = StationID;
     order.stationHeadID = 0;
     order.ComposeCommandReset();
     return order;
 }
コード例 #10
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 /// <summary>
 /// 如果升级读卡分站则是读卡分站的复位命令
 /// </summary>
 /// <returns></returns>
 public Order BuildOrderCmdReset()
 {
     Order order = new Order(OrderID.Reset);
     order.stationID = StationID;
     order.stationHeadID = Convert.ToInt16(StationHeadID);
     order.ComposeCommandReset();
     return order;
 }
コード例 #11
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 public Order BuildOrderCmdPointChip()
 {
     Order order = new Order(OrderID.Upgrade);
     order.chipGroup = this.chipGroup;//所属芯片
     order.stationID = StationID;
     order.stationHeadID = StationHeadID;
     order.orderType = OrderType.Upgrade;
     order.fileLength = this.fileLength;
     order.ComposeCommandPointChip();
     return order;
 }
コード例 #12
0
ファイル: ComCommand.cs プロジェクト: dalinhuang/KJ128Up
 public Order BuildOrderCmdGetVersion()
 {
     Order order = new Order(OrderID.Upgrade);
     order.chipGroup = ChipGroup.LPC2220;//所属芯片
     order.stationID = StationID;
     order.stationHeadID = 0x00;
     order.orderType = OrderType.Reset;
     order.ComposeCommandGetVersion();
     return order;
 }