123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- //Add code
- using System.IO;
- using System.IO.Ports;
- namespace RF_TRIO_PLL_ZIG
- {
-
- public partial class Main_Form : Form
- {
- Serial serial = new Serial(); // Uart Open
- Bluecell_BootProtocol bluecell_BootProtocol = new Bluecell_BootProtocol();
- Update_Serial file = new Update_Serial();
- public byte Tdd_T_Sync = 0;
- public Main_Form()
- {
- InitializeComponent();
- serial.Serial_Initialize(ref comboBox_Port);
- }
-
- private void Firmware_Update_Click(object sender, EventArgs e)
- {
- OpenFileDialog ofd = new OpenFileDialog();
- //FileDownload file = new FileDownload();
- if (Ascii_checkBox.Checked == true)
- Ascii_checkBox.Checked = false;
- file.ShowFileOpenDialog(ref serial, ofd);
- }
- private void Crc16_Check_Click(object sender, EventArgs e)
- {
- #if false
- Crc16 crc16 = new Crc16();
- byte[] tempdata = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09,0x0A };
- label1.Text = crc16.CRC16_Generate(tempdata, 11).ToString();
- #endif
- this.serial.Test_Serial();
- }
- private void Button_PortOpen_Click(object sender, EventArgs e)
- {
- bool ret = false;
- ret = Serial_connectiondisable(serial.Serial_PortOpen(ref button_PortOpen, ref comboBox_Port));
- if (ret == true && timer.Enabled == false)
- {
- timer.Start(); //타이머를 발동시킨다.
- }
- else if (timer.Enabled == true)
- {
- timer.Stop(); //타이머를 멈춘다.
- }
- else
- {
- /*NOP*/
- }
- }
- private void ComboBox_Port_SelectedIndexChanged(object sender, EventArgs e)
- {
- serial.Serial_Name = comboBox_Port.SelectedItem.ToString();
- }
- private void Button_terminal_Click(object sender, EventArgs e)
- {
- serial.Serial_TerminalOpen(serial);
- }
- public bool Serial_connectiondisable(Boolean on_off)
- {
- comboBox_Port.Enabled = on_off;
- comboBox_baudrate.Enabled = on_off;
- return on_off;
- }
- private void timer_Tick(object sender, EventArgs e)
- {
- }
- private void button_Set_Click(object sender, EventArgs e)
- {
- bluecell_BootProtocol.Bluecell_BtnSet(this.serial,this);
- }
- private void Main_Form_Load(object sender, EventArgs e)
- {
- pictureBox_PATH_1_8G_DL_ON.Visible = false;
- pictureBox_PATH_1_8G_UL_ON.Visible = false;
- pictureBox_PATH_2_1G_DL_ON.Visible = false;
- pictureBox_PATH_2_1G_UL_ON.Visible = false;
- pictureBox_PATH_3_5G_L_ON.Visible = false;
- pictureBox_PATH_3_5G_H_ON.Visible = false;
- pictureBox_PLL_ON_OFF_3_5G_L_ON.Visible = false;
- pictureBox_PLL_ON_OFF_3_5G_H_ON.Visible = false;
- pictureBox_PATH_3_5G_UL_ON.Visible = false;
- pictureBox_PATH_3_5G_DL_ON.Visible = false;
- pictureBox_G_RX.Visible = false;
- pictureBox_G_TX.Visible = false;
- /* public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_L_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_H_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PLL_ON_OFF_3_5G_L_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PLL_ON_OFF_3_5G_H_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_UL_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_DL_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_2_1G_UL_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_2_1G_DL_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_1_8G_UL_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_1_8G_DL_OFF;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_L_ON;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_H_ON;
- public System.Windows.Forms.PictureBox pictureBox_PLL_ON_OFF_3_5G_L_ON;
- public System.Windows.Forms.PictureBox pictureBox_PLL_ON_OFF_3_5G_H_ON;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_UL_ON;
- public System.Windows.Forms.PictureBox pictureBox_PATH_3_5G_DL_ON;
- public System.Windows.Forms.PictureBox pictureBox_PATH_2_1G_UL_ON;
- public System.Windows.Forms.PictureBox pictureBox_PATH_2_1G_DL_ON;
- public System.Windows.Forms.PictureBox pictureBox_PATH_1_8G_UL_ON;;*/
- }
- private void ATT_Enter(object sender, KeyEventArgs e)
- {
- if (e.KeyCode == Keys.Enter)
- {
- button_Set_Click(sender, e);
- //to do
- }
- else
- {
- return;
- }
- }
-
- private void TDD_T_SYNC_Click(object sender, EventArgs e)
- {
- PictureBox pictureBox = (PictureBox)sender;
- Tdd_T_Sync = Convert.ToByte(pictureBox.Tag);
- bluecell_BootProtocol.Bluecell_BtnSet(this.serial, this);
-
- pictureBox_TDD_T_SYNC_UL_ON.Visible = !pictureBox_TDD_T_SYNC_UL_ON.Visible;
- pictureBox_TDD_T_SYNC_DL_OFF.Visible = !pictureBox_TDD_T_SYNC_DL_OFF.Visible;
- }
- }
- }
|