Ejemplo n.º 1
0
        void _client_OnGetLiveView3(object sender, KeyConductorSDK.V3.LiveViewEventArgs e)
        {
            // GetLiveView performance (firmware 3.1.0):
            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"));
            }
        }
Ejemplo n.º 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();
                }
            }
        }