123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace FPER
- {
- public partial class FormBoardDataDownload : Form
- {
-
- frmReceiverConfig parent = null;
- MDIParent Mdi;
- public frmReceiverConfig frmReceiverConfig { get; private set; }
- public FormBoardDataDownload(frmReceiverConfig parent)
- {
- this.parent = parent;
- InitializeComponent();
- }
- public void SetMessage(string msg)
- {
-
- this.label1.Text = msg;
- }
- public void SetBoardData(List<CTBoard> LTBoard, MDIParent mdi)
- {
-
- this.button1.Visible = false;
- this.button2.Visible = false;
- this.listView1.Items.Clear();
-
- int boardID_init = 0;
- int boardID_cnt = 0;
- int loopNo_init = 0;
- int LoopNo_cnt = 0;
- Mdi = mdi;
-
- if (mdi.ReceiverModel == "IFC3300")
- {
- boardID_init = 0;
- boardID_cnt = 65;
- loopNo_init = 0;
- LoopNo_cnt = 4;
- }
- else
- {
- boardID_init = 1;
- boardID_cnt = 17;
- loopNo_init = 0;
- LoopNo_cnt = 2;
- }
-
- for (int i = boardID_init; i < boardID_cnt; i++)
- {
- if (mdi.ReceiverModel == "IFC3300")
- {
-
-
-
-
-
-
- LoopNo_cnt = 4;
- }
-
- for (int j = loopNo_init; j < LoopNo_cnt; j++)
- {
- string name = string.Format("{0}-{1}계통", i, j);
- ListViewItem item = new ListViewItem(name);
- ListViewItem.ListViewSubItem itemStatus = new ListViewItem.ListViewSubItem();
- itemStatus.Text = "미설정";
- CTBoard board = null;
- foreach (CTBoard tboard in LTBoard)
- {
- if (tboard.boardID == i)
- board = tboard;
- }
- if (board == null) itemStatus.Text = "미설정";
- else if (board.use == false) itemStatus.Text = "미사용";
-
- else if (j == 0)
- {
- if (board.loop0Use) itemStatus.Text = "대기";
- else itemStatus.Text = "미사용";
- }
- else if (j == 1)
- {
- if (board.loop1Use) itemStatus.Text = "대기";
- else itemStatus.Text = "미사용";
- }
- else if (j == 2)
- {
- if (board.loop2Use) itemStatus.Text = "대기";
- else itemStatus.Text = "미사용";
- }
- else if (j == 3)
- {
- if (board.loop3Use) itemStatus.Text = "대기";
- else itemStatus.Text = "미사용";
- }
- item.SubItems.Add(itemStatus);
- item.ForeColor = Color.Gray;
- this.listView1.Items.Add(item);
- }
- }
- }
- public void SetBoardDataDownloadResult(int boardID, int loopNo, int status, MDIParent mdi)
- {
-
- int ItemCnt = 0;
- if (mdi.ReceiverModel == "IFC3300")
- ItemCnt = 65 * 4;
-
- else
- ItemCnt = 16 * 2;
- if (this.listView1.Items.Count == ItemCnt)
- {
-
-
- ListViewItem item = null;
- string name = string.Format("{0}-{1}계통", boardID, loopNo);
- foreach (ListViewItem lvItem in this.listView1.Items)
- {
- if (lvItem.Text == name)
- item = lvItem;
- }
- if (item == null)
- return;
- ListViewItem.ListViewSubItem itemStatus = item.SubItems[1];
- switch (status)
- {
- case 0:
- {
- item.ForeColor = Color.Red;
- itemStatus.Text = "실패";
- break;
- }
- case 1:
- {
- item.ForeColor = Color.Blue;
- itemStatus.Text = "성공";
- break;
- }
- }
- }
- }
- public void SetProgress(int position)
- {
- if (position >= this.progressBar1.Minimum && position <= this.progressBar1.Maximum)
- {
- this.progressBar1.Value = position;
- }
- }
- public void SetFinish()
- {
- this.progressBar1.Value = this.progressBar1.Maximum;
- this.button1.Visible = true;
- }
- public void SetSucess()
- {
-
- this.SetMessage("설정정보 쓰기가 완료되었습니다. \r\n완료를 눌러 데몬을 Reset해 주십시오");
- this.button1.Visible = true;
- }
- public void SetFalse()
- {
-
- this.SetMessage("설정정보 쓰기 일부 실패하였습니다. \r\n재시도하거나 완료를 눌러 데몬을 Reset해 주십시오");
- this.button1.Visible = true;
-
-
- }
- private void button1_Click(object sender, EventArgs e)
- {
- parent.timer.Enabled = false;
- this.SetMessage("데몬을 Reset 하였습니다. 잠시 기다려 주십시오");
- this.button1.Enabled = false;
- parent.panel1.Enabled = true;
- Mdi.panel8.Enabled = true;
-
- parent.panel_Menu.Enabled = true;
- this.parent.ResetDemon();
- this.Close();
- }
- private void button2_Click(object sender, EventArgs e)
- {
- this.parent.ReceiverConfigWriteAll();
- }
- private void FormBoardDataDownload_Load(object sender, EventArgs e)
- {
- this.button1.Visible = false;
- this.button2.Visible = false;
- this.TopMost = true;
- this.CenterToParent();
- }
- private void FormBoardDataDownload_Deactivate(object sender, EventArgs e)
- {
- this.Activate();
- }
- private void FormBoardDataDownload_MdiChildActivate(object sender, EventArgs e)
- {
- this.Activate();
- }
- private void FormBoardDataDownload_EnabledChanged(object sender, EventArgs e)
- {
- this.Activate();
- }
- private void FormBoardDataDownload_Leave(object sender, EventArgs e)
- {
- this.Activate();
- }
- }
- }
|