コード例 #1
0
        /// <summary>
        /// Conforms to the Logger.ValueWriterHandler delegate. Writes a bool signal collection as a binary string
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public static string ValueWriterBinary(object o)
        {
            SignalCollection <bool> sc = o as SignalCollection <bool>;

            if (sc != null)
            {
                string s;
                SignalCollection <bool> .Convert(sc.Read(), out s);

                return(s);
            }
            else
            {
                return(o.ToString());
            }
        }
コード例 #2
0
        /// <summary>
        /// Conforms to the Logger.ValueWriterHandler delegate. Writes a bool signal collection as an unsigned integer
        /// </summary>
        /// <param name="o"></param>
        /// <returns></returns>
        public static string ValueWriterUnsignedInteger(object o)
        {
            SignalCollection <bool> sc = o as SignalCollection <bool>;

            if (sc != null)
            {
                uint s;
                SignalCollection <bool> .Convert(sc.Read(), out s);

                return(s.ToString());
            }
            else
            {
                return(o.ToString());
            }
        }
コード例 #3
0
 /// <summary>
 /// Converts the signal collection into a string. If it is a bool signal collection it writes the value as a binary value.
 /// </summary>
 /// <returns></returns>
 public override string ToString()
 {
     if (this is SignalCollection <bool> )
     {
         SignalCollection <bool> sc = this as SignalCollection <bool>;
         uint u;
         Convert(sc.Read(), out u);
         //string s;
         //Convert(sc.Read(), out s);
         return(u.ToString());
     }
     else
     {
         return(base.ToString());
     }
 }