Example #1
0
        public void DBWriter(string file)
        {
            if (!Success)
            {
                return;
            }

            IO = File.OpenWriter();
            if (file.Contains("PvList"))
            {
                if (pvList.Length > 0)
                {
                    for (int i = 0; i < pvList.Length; i++)
                    {
                        IO.Write(UrlEncode(pvList[i].ToString() +
                                           (i + 1 != pvList.Length ? c : "")));
                    }
                }
                else
                {
                    IO.Write("%2A%2A%2A");
                }
            }

            byte[] data = IO.ToArray(true);

            ushort checksum = DCC.CalculateChecksum(data);
            uint   time     = (uint)DateTime.Now.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;

            File.WriteAllBytes(file + "_" + checksum + "_" + time + ".dat", data);
        }
Example #2
0
        public void DBWriter(string file, uint num2)
        {
            if (!Success)
            {
                return;
            }

            byte[] data = DBWriter(file);
            if (data == null)
            {
                return;
            }

            ushort num = DCC.CalculateChecksum(data);

            File.WriteAllBytes(file + "_" + num + "_" + num2 + ".dat", data);
        }
Example #3
0
        public void DBWriter(string file, uint num2)
        {
            if (!Success)
            {
                return;
            }

            _IO = File.OpenWriter();
            if (file.Contains("psrData"))
            {
                if (psrData != null && psrData.Length > 0)
                {
                    for (i = 0; i < psrData.Length; i++)
                    {
                        _IO.W(psrData[i].ToString() + c);
                    }
                }
            }
            else if (file.Contains("PvList"))
            {
                if (pvList != null && pvList.Length > 0)
                {
                    for (i = 0; i < pvList.Length; i++)
                    {
                        _IO.W(UrlEncode(pvList[i].ToString() +
                                        (i < pvList.Length ? c : "")));
                    }
                }
                else
                {
                    _IO.W("%2A%2A%2A");
                }
            }

            byte[] data = _IO.ToArray(true);
            ushort num  = DCC.CalculateChecksum(data);

            File.WriteAllBytes(file + "_" + num + "_" + num2 + ".dat", data);
        }