Ejemplo n.º 1
0
        private void ShowLog()
        {
            var eventList = new List <GridLogEvent>();

            foreach (var logEntry in robotContext.robotLogEntries)
            {
                GridLogEvent.MakeEvent(logEntry, false, eventList);
            }
            gridLog.DataBind(eventList);
        }
Ejemplo n.º 2
0
        private void SetupGrids()
        {
            var blankEvent = new GridLogEvent();

            // таблица - лог роботов
            gridLog.Columns.Add(new FastColumn(blankEvent.Property(p => p.Time), Localizer.GetString("TitleTime"))
            {
                ColumnWidth = 90,
                SortOrder   = FastColumnSort.Ascending
            });
            gridLog.Columns.Add(new FastColumn(blankEvent.Property(p => p.RobotTitle), Localizer.GetString("TitleRobot"))
            {
                ColumnMinWidth = 50
            });
            gridLog.Columns.Add(new FastColumn(blankEvent.Property(p => p.Message), Localizer.GetString("TitleMessage"))
            {
                ColumnMinWidth = 40
            });
            gridLog.CheckSize();
            gridLog.CalcSetTableMinWidth();

            // статистика
            var blankStat = new StatisticsParam();

            gridStat.MultiSelectEnabled = true;
            gridStat.Columns.Add(new FastColumn(blankStat.Property(p => p.Title), Localizer.GetString("TitleParameter"))
            {
                //SortOrder = FastColumnSort.Ascending,
                ColumnMinWidth = 55
            });
            gridStat.Columns.Add(new FastColumn(blankStat.Property(p => p.Value), Localizer.GetString("TitleValue"))
            {
                ColumnMinWidth = 45,
                rowFormatter   = valueObject => ((StatisticsParam)valueObject).formatter == null
                                                      ? ((StatisticsParam)valueObject).Value.ToString()
                                                      : ((StatisticsParam)valueObject).formatter(
                    ((StatisticsParam)valueObject).Value)
            });
            gridStat.Columns.Add(new FastColumn(blankStat.Property(p => p.Description),
                                                Localizer.GetString("TitleDescription"))
            {
                ColumnMinWidth = 55
            });
            gridStat.CheckSize();
            gridStat.CalcSetTableMinWidth();
        }
Ejemplo n.º 3
0
        public static void MakeEvent(RobotLogEntry entry, bool showHints, List <GridLogEvent> eventList)
        {
            foreach (var msg in entry.Messages)
            {
                var hint = RobotHint.ParseString(msg);
                if (hint != null && !showHints)
                {
                    continue;
                }

                var evt = new GridLogEvent
                {
                    Message    = msg,
                    Time       = entry.Time,
                    RobotTitle = entry.Robot.TypeName + ":" +
                                 entry.Robot.Magic
                };
                eventList.Add(evt);
            }
        }
Ejemplo n.º 4
0
        public static void MakeEvent(RobotLogEntry entry, bool showHints, List<GridLogEvent> eventList)
        {
            foreach (var msg in entry.Messages)
            {
                var hint = RobotHint.ParseString(msg);
                if (hint != null && !showHints) continue;

                var evt = new GridLogEvent
                              {
                                  Message = msg,
                                  Time = entry.Time,
                                  RobotTitle = entry.Robot.TypeName + ":" +
                                               entry.Robot.Magic
                              };
                eventList.Add(evt);
            }
        }
Ejemplo n.º 5
0
        private void SetupGrids()
        {
            var blankEvent = new GridLogEvent();
            // таблица - лог роботов
            gridLog.Columns.Add(new FastColumn(blankEvent.Property(p => p.Time), Localizer.GetString("TitleTime"))
                {
                    ColumnWidth = 90,
                    SortOrder = FastColumnSort.Ascending
                });
            gridLog.Columns.Add(new FastColumn(blankEvent.Property(p => p.RobotTitle), Localizer.GetString("TitleRobot"))
                {
                    ColumnMinWidth = 50
                });
            gridLog.Columns.Add(new FastColumn(blankEvent.Property(p => p.Message), Localizer.GetString("TitleMessage"))
                {
                    ColumnMinWidth = 40
                });
            gridLog.CheckSize();
            gridLog.CalcSetTableMinWidth();

            // статистика
            var blankStat = new StatisticsParam();
            gridStat.Columns.Add(new FastColumn(blankStat.Property(p => p.Title), Localizer.GetString("TitleParameter"))
                {
                    //SortOrder = FastColumnSort.Ascending,
                    ColumnMinWidth = 55
                });
            gridStat.Columns.Add(new FastColumn(blankStat.Property(p => p.Value), Localizer.GetString("TitleValue"))
                {
                    ColumnMinWidth = 45,
                    rowFormatter = valueObject => ((StatisticsParam) valueObject).formatter == null
                                                      ? ((StatisticsParam) valueObject).Value.ToString()
                                                      : ((StatisticsParam) valueObject).formatter(
                                                          ((StatisticsParam) valueObject).Value)
                });
            gridStat.Columns.Add(new FastColumn(blankStat.Property(p => p.Description),
                                                Localizer.GetString("TitleDescription"))
                {
                    ColumnMinWidth = 55
                });
            gridStat.CheckSize();
            gridStat.CalcSetTableMinWidth();
        }