示例#1
0
        public void AddIndicators(List <IndicatorInfo> indicators)
        {
            indicators_ = indicators;
            var indicatorsString = string.Join("; ", indicators_.Select(x => x.ToString()).ToArray());

            _connectedMonitorsLogger.LogMessage("Monitor: {0} | Number: {1} | Color: {2} | Indicators: {4} | Display color: {3}",
                                                Index + 1,
                                                DisplayValue.ToString(),
                                                MonitorColor.ToString(),
                                                DisplayColor.ToString(),
                                                indicatorsString.Length > 0 ? indicatorsString : "None");
        }
示例#2
0
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();

            builder.Append("Monitor: [");
            builder.AppendFormat("Index = {0}; ", Index);
            builder.AppendFormat("DisplayValue = {0}; ", DisplayValue);
            builder.AppendFormat("Color = {0}; ", MonitorColor.ToString());
            builder.AppendFormat("DisplayColor = {0}; ", DisplayColor.ToString());
            builder.AppendFormat("Score = {0}; ", Score.ToString());
            builder.AppendFormat("Indicators = [{0}]; ", string.Join("; ", indicators_.Select(x => x.ToString()).ToArray()));
            builder.AppendFormat("Outcables = [{0}]", string.Join("; ", outCables_.Select(x => x.ToString()).ToArray()));
            builder.AppendFormat("Incables = [{0}]", string.Join("; ", inCables_.Select(x => x.ToString()).ToArray()));
            builder.Append("]");

            return(builder.ToString());
        }
示例#3
0
        public MonitorType GetMonitorType()
        {
            switch (MonitorColor)
            {
            case Color.Red:
                return(ToMonitorType(Score, MonitorType.RedEven, MonitorType.RedOdd));

            case Color.Blue:
                return(ToMonitorType(Score, MonitorType.BlueEven, MonitorType.BlueOdd));

            case Color.Green:
                return(ToMonitorType(Score, MonitorType.GreenEven, MonitorType.GreenOdd));

            case Color.Orange:
                return(ToMonitorType(Score, MonitorType.OrangeEven, MonitorType.OrangeOdd));

            case Color.Purple:
                return(ToMonitorType(Score, MonitorType.PurpleEven, MonitorType.PurpleOdd));

            default:
                throw new InvalidOperationException(string.Format("Invalid color: {0}", MonitorColor.ToString()));
            }
        }