protected void Page_Load(object sender, EventArgs e)
        {
            RightMgr.getInstance().opCheck("viewlog", Session, Response);

            if (!IsPostBack)
            {
                int count = OpLogMgr.getInstance().getOpInfoCount();
                for (int i = -1; i < count; i++)
                {
                    OpInfo info = OpLogMgr.getInstance().getOpInfo(i);
                    if (info != null)
                    {
                        opType.Items.Add(new ListItem(info.m_opName, info.m_opType.ToString()));
                    }
                    else
                    {
                        opType.Items.Add(new ListItem("全部", i.ToString()));
                    }
                }

                GMUser user = (GMUser)Session["user"];
                if (user.m_type != "admin")
                {
                    Button2.Visible = false;
                }

                if (m_gen.parse(Request))
                {
                    opType.SelectedIndex = m_gen.m_opType;
                    m_time.Text          = m_gen.m_time;
                    onSearchLog(null, null);
                }
            }
        }
        /// <summary>
        /// 获取结果
        /// </summary>
        /// <returns></returns>
        public DataTable dataRecive(OpInfo info)
        {
            DataTable dt     = null;
            string    errMsg = "";

            try
            {
                string paratime = GetParams(info);
                _logHelper.AppendMessageToTxt(string.Format("时间范围为:{0}", paratime));
                dt = GetDataTable(paratime, out errMsg);

                //将取得的结果保存到数据库中
                if (dt != null && dt.Rows.Count > 0)
                {
                    DataTableSecondaryTreatment(ref dt);
                    button_save_sys(dt, GetYqType());
                }
                else
                {
                    _logHelper.AppendMessageToTxt(string.Format("{0}:数据不存在", DateHelper.CurrDateTime()));
                }
                if (info.OpType != "0")
                {
                    _needToOperation = false;
                }
            }
            catch (Exception ex)
            {
                Jktj_lis.msgShow(ex.Message);
            }
            return(dt);
        }
Exemple #3
0
        private void button_again_Click(object sender, EventArgs e)
        {
            OpInfo info = new OpInfo(dateTimePicker_start.Value.ToString("yyyy-MM-dd"), dateTimePicker_end.Value.ToString("yyyy-MM-dd"), "1");

            _needToOperation = true;
            Operation(info);
        }
Exemple #4
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogModifyFishlordRoomExpRate param = BaseJsonSerializer.deserialize <LogModifyFishlordRoomExpRate>(str);

        if (param.m_roomList == "")
        {
            return("");
        }

        string[] arrs = Tool.split(param.m_roomList, ',', StringSplitOptions.RemoveEmptyEntries);
        string   room = "";

        for (int i = 0; i < arrs.Length; i++)
        {
            int roomType = Convert.ToInt32(arrs[i]);
            room += StrName.s_roomName[roomType - 1] + ",";
        }

        return(string.Format(info.m_fmt, room, StrName.s_gameName[param.m_gameId]));
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            RightMgr.getInstance().opCheck("viewlog", Session, Response);

            if (!IsPostBack)
            {
                int count = OpLogMgr.getInstance().getOpInfoCount();
                opType.Items.Add(new ListItem("全部", "0"));
                for (int i = 1; i < LogType.LOG_TYPE_MAX; i++)
                {
                    OpInfo info = OpLogMgr.getInstance().getOpInfo(i);
                    if (info != null)
                    {
                        opType.Items.Add(new ListItem(info.m_opName, info.m_opType.ToString()));
                    }
                }

                if (m_gen.parse(Request))
                {
                    opType.SelectedIndex = m_gen.m_opType;
                    m_time.Text          = m_gen.m_time;
                    onSearchLog(null, null);
                }
            }
        }
Exemple #6
0
        private void Operation(OpInfo info)
        {
            Task t = new Task(() =>
            {
                try
                {
                    _logHelper = new LogHelper(string.Format("{0}_recieve", yqxh), true);//在开始之前初始话
                    _logHelper.AppendMessageToTxt(string.Format("心电开始处理,仪器型号为:{0},获取时间间隔为:{1},当前时间为:{2}", yqxh, _interval,
                                                                DateHelper.CurrDateTime()));
                    //改变按钮文字状态为执行
                    ButtonAndTextboxStatus(false, "心电结果处理中......");
                    while (_needToOperation)
                    {
                        Thread.Sleep(_interval);
                        dataRecive(info);
                    }
                    //改变按钮文字状态为结束
                    ButtonAndTextboxStatus(true, "心电结果处理结束");
                    _logHelper.AppendMessageToTxt(string.Format("{0}:心电结果处理结束", DateHelper.CurrDateTime()));
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            });

            t.Start();
        }
Exemple #7
0
        ChannelBlendDesc GetChannelBlendDescImpl(
            OpInfo info,
            AttrCase channel)
        {
            // \todo: Need to pick whether left or right is src/dest
            ChannelBlendDesc result;

            var left  = info._left;
            var right = info._right;

            if (CanUseAs(left, channel, TermFlavor.Src) && CanUseAs(right, channel, TermFlavor.Dest))
            {
                result.srcBlend  = GetTermBlendDesc(info._left, channel, TermFlavor.Src);
                result.destBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Dest);
            }
            else if (CanUseAs(left, channel, TermFlavor.Dest) && CanUseAs(right, channel, TermFlavor.Src))
            {
                result.destBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Dest);
                result.srcBlend  = GetTermBlendDesc(info._right, channel, TermFlavor.Src);
            }
            else
            {
                throw OperationTooComplexError(info.Range);
            }
            result.op = info._op;
            return(result);
        }
Exemple #8
0
        private async Task <bool> SubmitAsync(OpMessageType msgType, IEnumerable <T> ops)
        {
            // compose all of the ops into one op
            JToken composedOp = null;

            foreach (T op in ops)
            {
                JToken serializedOp = Type.Serialize(op);
                composedOp = composedOp != null?Type.Compose(composedOp, serializedOp) : serializedOp;
            }

            // make sure that the last submit has completed
            if (_inflightOp != null)
            {
                await _inflightOp.Task;
            }

            // send op to server
            _inflightOp = new TaskCompletionSource <bool>();
            int seq = _conn.NextSeq();

            _inflightOpInfo = new OpInfo(msgType, seq, composedOp);
            await _conn.SendOpAsync(this, msgType, seq, composedOp);

            return(await _inflightOp.Task);
        }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            RightMgr.getInstance().opCheck("", Session, Response);
            GMUser user = (GMUser)Session["user"];

            if (!user.isAPIAcc())
            {
                Server.Transfer(DefCC.ASPX_EMPTY);
            }

            m_view = new CLogViewer(LogTable, m_page, m_foot, opType);
            if (!IsPostBack)
            {
                int count = OpLogMgr.getInstance().getOpInfoCount();
                opType.Items.Add(new ListItem("全部", "0"));
                for (int i = 0; i < s_ids.Length; i++)
                {
                    OpInfo info = OpLogMgr.getInstance().getOpInfo(s_ids[i]);
                    if (info != null)
                    {
                        opType.Items.Add(new ListItem(info.m_opName, info.m_opType.ToString()));
                    }
                }

                PageViewLog gen = m_view.getPageViewFoot();
                if (gen.parse(Request))
                {
                    opType.SelectedIndex = gen.m_opType;
                    m_time.Text          = gen.m_time;
                    onSearchLog(null, null);
                }
            }
        }
        private void fillTable(Dictionary <string, object> data, bool css)
        {
            if (data == null)
            {
                return;
            }

            s_content[0] = Convert.ToString(data["id"]);
            s_content[1] = Convert.ToString(data["OpDbIP"]);
            s_content[2] = Convert.ToString(data["account"]);
            s_content[3] = Convert.ToString(data["accountIP"]);
            OpInfo opinfo = OpLogMgr.getInstance().getOpInfo(Convert.ToInt32(data["OpType"]));

            if (opinfo != null)
            {
                s_content[4] = opinfo.m_opName;
            }
            else
            {
                s_content[4] = "未知";
            }

            s_content[5] = (Convert.ToDateTime(data["OpTime"])).ToLocalTime().ToString();
            if (opinfo.m_param != null)
            {
                s_content[6] = opinfo.m_param.getDescription(opinfo, Convert.ToString(data["OpParam"]));
            }
            else
            {
                s_content[6] = "未知";
            }

            if (data.ContainsKey("comment"))
            {
                s_content[7] = Convert.ToString(data["comment"]);
            }
            else
            {
                s_content[7] = "";
            }

            s_content[8] = Tool.getCheckBoxHtml("sel", s_content[0], false);
            TableRow tr = new TableRow();

            if (css)
            {
                tr.CssClass = "alt";
            }

            LogTable.Rows.Add(tr);
            tr.ID = s_content[0];
            int col = s_head.Length;

            for (int i = 0; i < col; i++)
            {
                TableCell td = new TableCell();
                tr.Cells.Add(td);
                td.Text = s_content[i];
            }
        }
Exemple #11
0
        TargetBlendDesc GetTargetBlendDescImpl(OpInfo info)
        {
            TargetBlendDesc result;

            result.blendEnable = true;
            result.color       = GetChannelBlendDesc(info, AttrCase.Color);
            result.alpha       = GetChannelBlendDesc(info, AttrCase.Alpha);
            result.writeMask   = (UInt32)D3D11_COLOR_WRITE_ENABLE.D3D11_COLOR_WRITE_ENABLE_ALL;
            return(result);
        }
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogApiApprove param = BaseJsonSerializer.deserialize <LogApiApprove>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_apiAcc, param.m_aliasName));
        }
        return("");
    }
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogCreatePlayer param = BaseJsonSerializer.deserialize <LogCreatePlayer>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_acc));
        }
        return("");
    }
Exemple #14
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogResetPwd param = BaseJsonSerializer.deserialize <LogResetPwd>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_acc, param.m_phone));
        }
        return("");
    }
Exemple #15
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogFreezeHead param = BaseJsonSerializer.deserialize <LogFreezeHead>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt, param.m_playerId));
        }
        return("");
    }
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogReloadTable param = BaseJsonSerializer.deserialize <LogReloadTable>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 StrName.s_gameName[param.m_gameId]));
        }
        return("");
    }
Exemple #17
0
        void IDocumentInternal.HandleOp(ShareDBException ex, int version, int seq)
        {
            OpInfo opInfo = _inflightOpInfo;

            _inflightOpInfo = null;
            if (ex != null)
            {
                if (ex.Code == 4002)
                {
                    _inflightOp.SetResult(false);
                }
                else
                {
                    _inflightOp.SetException(ex);
                }
            }
            else if (seq != opInfo.Seq || (opInfo.MessageType != OpMessageType.Create && version != Version))
            {
                _inflightOp.SetException(new ShareDBException("Received incorrect op acknowledgement.", 4100));
            }
            else
            {
                switch (opInfo.MessageType)
                {
                case OpMessageType.Create:
                    Version  = version;
                    Data     = (T)Type.Deserialize(opInfo.Op);
                    IsLoaded = true;
                    break;

                case OpMessageType.Op:
                    Data     = (T)Type.Apply(Data, opInfo.Op);
                    IsLoaded = true;
                    break;

                case OpMessageType.Delete:
                    Data     = default(T);
                    IsLoaded = false;
                    break;
                }

                Version++;
                _inflightOp.SetResult(true);
            }
        }
Exemple #18
0
        private void SynCncOpInfo()
        {
            List <Tuple <string, string, OpInfo> > opInfos  = new List <Tuple <string, string, OpInfo> >();
            List <Tuple <string, string, NcInfo> > cncInfos = new List <Tuple <string, string, NcInfo> >();

            foreach (RMesDispatch dispatch in ModBusDataFactory.dispatrchs.OrderBy(v => v.OP_CODE))
            {
                _mesRepository = new Repository(SysConf.Main.DbMES);
                TB_ROUTE_OP rOuteOp = _mesRepository.Single <TB_ROUTE_OP>(v => v.OP_CODE == dispatch.OP_CODE);
                OpInfo      opInfo  = new OpInfo()
                {
                    OpSeq     = rOuteOp.OP_SEQ,
                    OpCode    = rOuteOp.OP_CODE,
                    OpDoc     = dispatch.OP_DOC,
                    OpDocPath = dispatch.OP_DOC_PATH,
                    OpDocVer  = dispatch.OP_DOC_VER
                };
                NcInfo ncInfo = new NcInfo()
                {
                    NcId   = dispatch.NC_ID,
                    NcPath = dispatch.NC_PATH,
                    NcVer  = dispatch.NC_VER
                };
                opInfos.Add(new Tuple <string, string, OpInfo>(dispatch.LINE, dispatch.EQUIP_CODE, opInfo));
                cncInfos.Add(new Tuple <string, string, NcInfo>(dispatch.LINE, dispatch.EQUIP_CODE, ncInfo));
            }
            //按设备编号正向排序,得出工序
            opInfos = opInfos.OrderBy(v => v.Item2).ToList();
            byte[] cncOp = new byte[12];
            int    i     = 0;

            foreach (Tuple <string, string, OpInfo> tuple in opInfos)
            {
                i++;
                cncOp[i] = Convert.ToByte(tuple.Item3.OpSeq);
            }
            var eng = ModBusDataFactory.workFlowEngines.FirstOrDefault(x => x.ModuleName == "WFE");
            //触发更新CnCOp模块
            FlowBlock block = eng?._workFlow.Blocks.FirstOrDefault(v => v.Name == "PLC00CncOpB");

            block.Steps[0].Value = Encoding.ASCII.GetString(cncOp);
            eng?.EnqueueBlock(block);
        }
Exemple #19
0
        static OpInfo[] Create(OpInfo[] a)
        {
            var res = new OpInfo[5];

            for (int i = 0; i < res.Length; i++)
            {
                OpInfo info;
                if (i < a.Length)
                {
                    info = a[i];
                }
                else
                {
                    info = InstructionInfo.OpInfo.None;
                }
                res[i] = info;
            }
            return(res);
        }
Exemple #20
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogBlockAcc param = BaseJsonSerializer.deserialize <LogBlockAcc>(str);

        if (param != null)
        {
            if (param.m_isBlock)
            {
                return(string.Format(info.m_fmt, "封", param.m_acc));
            }
            return(string.Format(info.m_fmt, "解封", param.m_acc));
        }
        return("");
    }
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogWishCurse param = BaseJsonSerializer.deserialize <LogWishCurse>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 StrName.s_gameName[param.m_gameId],
                                 param.m_playerId,
                                 param.m_opType == 0 ? "添加" : "去除",
                                 StrName.s_wishCurse[param.m_wishType]));
        }
        return("");
    }
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogPlayerOp param = BaseJsonSerializer.deserialize <LogPlayerOp>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 param.m_playerId,
                                 param.m_op == 1 ? "增加" : "减少",
                                 param.m_value,
                                 getProp(param)));
        }
        return("");
    }
Exemple #23
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogSendMail param = BaseJsonSerializer.deserialize <LogSendMail>(str);

        if (param != null)
        {
            if (param.m_playerList == "")
            {
                return(string.Format(info.m_fmt, "全服", param.m_title, param.m_sender, param.m_content, param.m_itemList, param.m_validDay));
            }
            return(string.Format(info.m_fmt, param.m_playerList, param.m_title, param.m_sender, param.m_content, param.m_itemList, param.m_validDay));
        }
        return("");
    }
Exemple #24
0
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogGmRecharge param = BaseJsonSerializer.deserialize <LogGmRecharge>(str);

        if (param != null)
        {
            RechargeCFGData rd = RechargeCFG.getInstance().getValue(param.m_param);
            if (rd != null)
            {
                return(string.Format(info.m_fmt, param.m_playerId, StrName.s_rechargeType[param.m_rtype], rd.m_price));
            }
        }
        return("");
    }
    public override string getDescription(OpInfo info, string str)
    {
        if (info == null)
        {
            return("引用空");
        }

        LogCowsAddCardType param = BaseJsonSerializer.deserialize <LogCowsAddCardType>(str);

        if (param != null)
        {
            return(string.Format(info.m_fmt,
                                 ItemHelp.getCowsCardTypeName(param.m_bankerType),
                                 ItemHelp.getCowsCardTypeName(param.m_other1Type),
                                 ItemHelp.getCowsCardTypeName(param.m_other2Type),
                                 ItemHelp.getCowsCardTypeName(param.m_other3Type),
                                 ItemHelp.getCowsCardTypeName(param.m_other4Type)));
        }
        return("");
    }
Exemple #26
0
 public stmx()
 {
     info = new OpInfo("ST", "Store Indirect From Register to Data Space using Index X",
                       new Regex(@"1001001\d{5}1110", RegexOptions.Compiled));
 }
Exemple #27
0
 public sev()
 {
     info = new OpInfo("SEV", "Set Overflow Flag",
                       new Regex(@"1001010000111000", RegexOptions.Compiled));
 }
Exemple #28
0
 public ldxp()
 {
     info = new OpInfo("LD", "Load Indirect from Data Space to Register using Index X",
                       new Regex(@"1001000\d{5}1101", RegexOptions.Compiled));
 }
        ChannelBlendDesc GetChannelBlendDescImpl(
            OpInfo info,
            AttrCase channel)
        {
            // \todo: Need to pick whether left or right is src/dest
            ChannelBlendDesc result;

            var left = info._left;
            var right = info._right;
            if (CanUseAs(left, channel, TermFlavor.Src) && CanUseAs(right, channel, TermFlavor.Dest))
            {
                result.srcBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Src);
                result.destBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Dest);
            }
            else if (CanUseAs(left, channel, TermFlavor.Dest) && CanUseAs(right, channel, TermFlavor.Src))
            {
                result.destBlend = GetTermBlendDesc(info._left, channel, TermFlavor.Dest);
                result.srcBlend = GetTermBlendDesc(info._right, channel, TermFlavor.Src);
            }
            else
            {
                throw OperationTooComplexError(info.Range);
            }
            result.op = info._op;
            return result;
        }
Exemple #30
0
 public bclr()
 {
     info = new OpInfo("BCLR", "Bit Clear in SREG",
                       new Regex(@"100101001\d{3}1000", RegexOptions.Compiled));
 }
Exemple #31
0
 public subi()
 {
     info = new OpInfo("SUBI", "Subtract Immediate",
                       new Regex(@"0101\d{12}", RegexOptions.Compiled));
 }
 TargetBlendDesc GetTargetBlendDescImpl(OpInfo info)
 {
     TargetBlendDesc result;
     result.blendEnable = true;
     result.color = GetChannelBlendDesc(info, AttrCase.Color);
     result.alpha = GetChannelBlendDesc(info, AttrCase.Alpha);
     result.writeMask = (UInt32)D3D11_COLOR_WRITE_ENABLE.D3D11_COLOR_WRITE_ENABLE_ALL;
     return result;
 }