コード例 #1
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     try
     {
         PlotterContent contentMaster = new PlotterContent(master);
         if (textBox_name.Text != "")
         {
             contentMaster.UploadVector(new CWA.Vectors.Vector(textBox_pcName.Text), textBox_name.Text);
         }
         else
         {
             contentMaster.UploadVector(new CWA.Vectors.Vector(textBox_pcName.Text).ClearThisVector(2));
         }
         DialogResult = DialogResult.OK;
     }
     catch (Exception ex)
     {
         MessageBox.Show(
             string.Format(
                 TB.L.Phrase["Form_Dialog_PrintEnterNames.ErrorWhileUploading"],
                 ex.GetType().FullName,
                 ex.StackTrace,
                 ex.Message),
             TB.L.Phrase["Form_Dialog_PrintEnterNames.Error"],
             MessageBoxButtons.OK, MessageBoxIcon.Error);
         DialogResult = DialogResult.Abort;
     }
 }
コード例 #2
0
 private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
 {
     if (contentMaster == null)
     {
         contentMaster = new PlotterContent(master);
     }
     else
     {
         contentMaster.Refresh();
     }
     Metas = contentMaster.GetAllVectorsMetaData();
     foreach (var item in Metas)
     {
         item.DownloadPreview();
     }
 }
コード例 #3
0
 public FlFormatPrintMaster(DTPMaster master) : base(master)
 {
     Content = new PlotterContent(master);
 }
コード例 #4
0
 private void button_connect_Click(object sender, EventArgs e)
 {
     if (button_connect.Text == TB.L.Phrase["Connection.Disconnect"])
     {
         Master?.CloseConnection();
         groupBox_presets.Enabled = false;
         groupBox_macro.Enabled   = false;
         button_connect.Text      = TB.L.Phrase["Connection.Connect"];
         comboBox_bd.Enabled      = true;
         comboBox_port.Enabled    = true;
     }
     else
     {
         if (comboBox_bd.Text == "")
         {
             MessageBox.Show(
                 TB.L.Phrase["Connection.EnterBDRate"],
                 TB.L.Phrase["Connection.Error"],
                 MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         Master?.CloseConnection();
         groupBox_presets.Enabled = false;
         groupBox_macro.Enabled   = false;
         SerialPort port = new SerialPort(comboBox_port.Text, int.Parse(comboBox_bd.Text));
         try
         {
             port.Open();
         }
         catch
         {
             MessageBox.Show(
                 string.Format(TB.L.Phrase["Connection.UnableToOpenPort"], comboBox_port.Text),
                 TB.L.Phrase["Connection.Error"],
                 MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         Master = new DTPMaster(
             new SerialPacketReader(port),
             new SerialPacketWriter(port));
         try
         {
             if (!Master.Device.Test())
             {
                 MessageBox.Show(
                     TB.L.Phrase["Connection.DeviceNotAnswered"],
                     TB.L.Phrase["Connection.Error"],
                     MessageBoxButtons.OK, MessageBoxIcon.Error);
                 return;
             }
         }
         catch
         {
             MessageBox.Show(
                 TB.L.Phrase["Connection.DeviceNotAnswered"],
                 TB.L.Phrase["Connection.Error"],
                 MessageBoxButtons.OK, MessageBoxIcon.Error);
             return;
         }
         groupBox_presets.Enabled          = true;
         groupBox_macro.Enabled            = true;
         comboBox_bd.Enabled               = false;
         comboBox_port.Enabled             = false;
         button_connect.Text               = TB.L.Phrase["Connection.Disconnect"];
         ContentMaster                     = new PlotterContent(Master);
         tabControl1.Enabled               = false;
         loadingCircle_previewLoad.Visible = true;
         backgroundWorker1.RunWorkerAsync();
     }
 }