Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (ExecuteTest)
     {
         string genBytesUrl = ResolveClientUrl(CallBackUrl);
         string script      = AstMainScript.Text
                              .Replace("{$GEN_BYTES_URL$}", genBytesUrl)
                              .Replace("{$BYTE_LENGTH$}", ByteLength.ToString())
                              .Replace("{$COMPLETE_FUNCTION$}", ClientCompleteFunction)
                              .Replace("{$USE_COOKIE$}", UseCookie.ToString().ToLower())
                              .Replace("{$COOKIE_EXPIRES$}", CookieExpires.TotalDays.ToString());
         Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "AjaxSpeedTest",
                                                     script);
     }
 }
Пример #2
0
 public override int GetHashCode()
 {
     return((EncryptedHash?.GetHashCode().ToString() + RelativeFilePath.ToString() + ByteLength.ToString()).GetHashCode());
 }
Пример #3
0
        public override string ToDebugString(Frame fmsg)
        {
            var    msg = (N2kFrame)fmsg;
            string s   = ((N2kHeader)msg.Header).PGN.ToString() + ": " + (Name ?? "") + "\nSource=" + msg.Header.PGNSource + "\nDestination=" + msg.Header.PGNDestination + "\nPriority=" + msg.Header.PGNPriority + "\nExpected Length=" + ByteLength.ToString() + " bytes" + "\nActual Length=" + msg.Data.Length + " bytes\n";

            // string s = ((N2kHeader)msg.Header).PGN.ToString() + ": " + (Name ?? "") + ", Source=" + msg.Header.PGNSource + ", Destination=" + msg.Header.PGNDestination + ", Priority=" + msg.Header.PGNPriority + ", Length=" + ByteLength.ToString() + " bytes\n";
            if ((msg.Defn == null) || (msg.Defn is PGNDefnUnknown))
            {
                // We output each byte with its binary representation
                for (int i = 0; i < msg.Data.Length; i++)
                {
                    s = s + Tools.Dump(msg.Data, 8 * i, 8);
                    s = s + "  " + "Byte " + i.ToString() + "\n";
                }
            }
            else
            {
                foreach (N2kField f in Fields)
                {
                    var BitOffset = f.BitOffset;
                    // We ignore fields that have not been transmitted, eg see PGN 127250
                    if (f.BitOffset + f.BitLength <= (msg.Data.Length) << 3)
                    {
                        s = s + f.DebugString(msg.Data);
                        s = s + "  " + f.Name + "=" + f.ToString(msg.Data) + "\n"; //  +"{" + (f as Field).ToString(msg.Data) + "}" + "\n";
                    }
                }
            }
            return(s);
        }
Пример #4
0
        public override string ToString(Frame fmsg)
        {
            var    msg = (N2kFrame)fmsg;
            string s   = ((N2kHeader)msg.Header).PGN.ToString() + ": " + (Name ?? "") + "\nSource=" + msg.Header.PGNSource + "\nDestination=" + msg.Header.PGNDestination + "\nPriority=" + msg.Header.PGNPriority + "\nExpected Length=" + ByteLength.ToString() + " bytes" + "\nActual Length=" + msg.Data.Length + " bytes\n";

            foreach (N2kField f in Fields)
            {
                // We ignore fields that have not been transmitted, eg see PGN 127250
                if (f.BitOffset + f.BitLength <= (msg.Data.Length) << 3)
                {
                    s = s + "  " + f.Name + "=" + f.ToString(msg.Data) + "\n"; //  +"{" + (f as Field).ToString(msg.Data) + "}" + "\n";
                }
            }
            return(s);
        }
Пример #5
0
 public override int GetHashCode() => (EncryptedHash.GetHashCode().ToString() + RelativeFilePath.ToString() + ByteLength.ToString()).GetHashCode();