Example #1
0
        void _client_OnGetLiveView(object sender, KeyConductorSDK.V2.LiveViewEventArgs e)
        {
            // GetLiveView performance (firmware 2.16RC7):
            //  24 slots = 1,2 sec
            // 108 slots = 2 sec
            // 180 slots ~= 3 sec
            // Parsing of slots in LVEventArgs is 1 ms

            if (e.ResultCode == Protocol.ReturnValues.OK)
            {
                AddLog("Result GetLiveView at " + DateTime.Now.ToString("HH:mm:ss:fff"));

                string filename = "GetFileResult." + e.Filename.ToString();

                if (filename.EndsWith("KCL"))
                {
                    filename += ".kcl";
                }
                if (filename.EndsWith("V3"))
                {
                    filename += ".v3";
                }

                if (File.Exists(filename))
                {
                    File.Delete(filename);
                }
                File.WriteAllBytes(filename, e.GetContents());
                AddLog("File saved as " + filename);

                AddLog(e.ToString());
                AddLog(e.SlotsToString());
                AddLog("Result GetLiveView done printing at " + DateTime.Now.ToString("HH:mm:ss:fff"));
            }
        }
Example #2
0
        private void LoadLiveViewFile()
        {
            if (File.Exists(txtFilename.Text) == false)
            {
            }
            else
            {
                Properties.Settings.Default.PreviousLogFile = txtFilename.Text;
                Properties.Settings.Default.Save();

                var arrBytes = File.ReadAllBytes(txtFilename.Text);

                if (txtFilename.Text.ToUpper().EndsWith(".V3"))
                {
                    var lv = new KeyConductorSDK.V3.LiveViewEventArgs("160101010101", Protocol.ReturnValues.OK, 0, arrBytes);
                    textBox1.Text = lv.ToString() + "\r\n" + lv.SlotsToString();
                }
                else
                {
                    var lv = new KeyConductorSDK.V2.LiveViewEventArgs("160101010101", Protocol.ReturnValues.OK, 0, arrBytes);
                    textBox1.Text = lv.ToString() + "\r\n" + lv.SlotsToString();
                }
            }
        }