123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381 |
- 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 frmVersion_BigReceiver : Form
- {
- public frmVersion_BigReceiver()
- {
- InitializeComponent();
-
- this.button_Menu_BasicSet.BackgroundImage = (Image)Properties.Resources.탭메뉴버튼_주황_100_30;
- }
- MDIParent mdi = null;
- delegate void deleFormInit();
-
- private void btnWinClose_Click(object sender, EventArgs e)
- {
- try
- {
- this.Close();
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- public void Form_Init()
- {
- try
- {
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void frmVersion_Load(object sender, EventArgs e)
- {
-
- SetStyle(ControlStyles.UserPaint, true);
-
- SetStyle(ControlStyles.AllPaintingInWmPaint, true);
-
- SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
- this.UpdateStyles();
- try
- {
- mdi = (MDIParent)this.MdiParent;
- txtThisReceiverID.Text = string.Format("{0:00}", mdi.myReceiverID);
-
- txtUIVersion.Text = Application.ProductVersion;
- txtDemonVersion.Text = "";
- txtFileVersion.Text = "0.0.0.0";
- Grid_init();
- this.Cursor = Cursors.WaitCursor;
-
- dCommandResponse d = new dCommandResponse(VersionInfoComplete);
-
- CmdInfo cmd = new CmdInfo(prt_cmd_define.read_command_status, mdi.myReceiverID, 1, 0, 0, d);
- cmd.CommandType = "VI";
- cmd.ApplyRange = "A";
- cmd.CommandData = null;
- mdi.ui.runCommand(cmd);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void frmVersion_Activated(object sender, EventArgs e)
- {
- try
- {
-
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- private void frmVersion_Disposed(object sender, EventArgs e)
- {
-
-
-
-
-
- try
- {
-
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
-
-
-
- public void VersionInfoComplete(CmdInfo cmd)
- {
- try
- {
- this.Cursor = Cursors.Default;
-
- if (!Util.ComInfoErrProcess(cmd, mdi.ui.Connected, "RCVData_ReadCommandStatus"))
- {
- return;
- }
- RCVData_ReadCommandStatus resData2 = (RCVData_ReadCommandStatus)cmd.ResponseData;
- string demonVer = string.Format("{0}.{1}.{2}.{3}", resData2.Reply_value1, resData2.Reply_value2, resData2.Reply_value3, resData2.Reply_value4);
- txtDemonVersion.Text = demonVer;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
-
-
-
- private void BrdVersionInfoComplete(CmdInfo cmd)
- {
- try
- {
- this.Cursor = Cursors.Default;
-
- if (!Util.ComInfoErrProcess(cmd, mdi.ui.Connected, "RCVData_ReadTBoardStatus"))
- {
- button_end(true);
- return;
- }
- if (cmd != null)
- {
-
-
-
-
-
-
-
- RCVData_ReadTBoardStatus res = (RCVData_ReadTBoardStatus)cmd.ResponseData;
- Label txt = (Label)Util.FineControl(tabPage2, string.Format("lbl_COMM{0}", res.TBD_ID));
- if (txt != null)
- {
- if (!txt.Text.Contains(":"))
- {
- txt.Text = txt.Text + " : " + string.Format("{0}.{1}", res.TBD_MainVersion, res.TBD_SubVersion);
- }
- }
- }
- if (cmd == null)
- {
- if (mdi.ui == null) return;
- ReceiverTypeInfo receiverInfo = mdi.ui.MyReceiverTypeInfo;
- if (receiverInfo == null) return;
- BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType;
- if (boardInfos != null)
- {
- foreach (BoardTypeInfo brd in boardInfos)
- {
- if (brd != null)
- {
- if (brd.UseFlag)
- {
- try
- {
- if (brd.BoardNo <= 64)
- {
- CmdInfo cmd2 = new CmdInfo(prt_cmd_define.resd_tbd_state, mdi.myReceiverID);
- cmd2.boardNo = brd.BoardNo;
- dCommandResponse d = new dCommandResponse(BrdVersionInfoComplete);
- cmd2.dEvent = d;
- this.mdi.ui.runCommand(cmd2);
- }
- else
- {
- button_end(true);
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- button_end(true);
- }
- }
- }
- }
- }
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- button_end(true);
- return;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
- private void Grid_init()
- {
- try
- {
- if (mdi.ui == null) return;
- ReceiverTypeInfo receiverInfo = mdi.ui.MyReceiverTypeInfo;
- if (receiverInfo == null) return;
-
-
-
- BoardTypeInfo[] boardInfos = receiverInfo.MyBoardType;
- if (boardInfos != null)
- {
- foreach (BoardTypeInfo brd in boardInfos)
- {
- if (brd != null)
- {
- if (brd.UseFlag)
- {
-
-
-
-
-
-
-
- Label txt = (Label)Util.FineControl(tabPage2, string.Format("lbl_COMM{0}", brd.BoardNo));
- if (txt != null)
- {
- txt.Enabled = true;
- }
- }
- }
- }
- }
-
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- throw ex;
- }
- }
- private void btnCommRead_Click(object sender, EventArgs e)
- {
- try
- {
-
- button_end(false);
-
-
- BrdVersionInfoComplete(null);
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- button_end(true);
- }
- }
-
- private void button_end(Boolean val)
- {
- try
- {
- if (val)
- {
- this.btnCommRead.Enabled = true;
- this.Cursor = Cursors.Default;
- }
- else
- {
- this.btnCommRead.Enabled = false;
- this.Cursor = Cursors.WaitCursor;
- }
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
- bool CheckBoardVersion = false;
- private void tabPage2_Enter(object sender, EventArgs e)
- {
- try
- {
- if (CheckBoardVersion == false)
- {
-
- BrdVersionInfoComplete(null);
- }
- CheckBoardVersion = true;
- }
- catch (Exception ex)
- {
- Util.UErrorMessage(ex, 0, 0);
- }
- }
-
-
-
- private void button_Menu_BasicSet_Click(object sender, EventArgs e)
- {
- button_Menu_Color_Init();
- this.tabControl1.SelectTab(0);
- this.button_Menu_BasicSet.BackgroundImage = (Image)Properties.Resources.탭메뉴버튼_주황_100_30;
- this.panel_Menu.Focus();
- }
- private void button_Menu_CommBoard_Click(object sender, EventArgs e)
- {
- button_Menu_Color_Init();
- this.tabControl1.SelectTab(1);
- this.button_Menu_CommBoard.BackgroundImage = (Image)Properties.Resources.탭메뉴버튼_주황_100_30;
- this.panel_Menu.Focus();
- }
- private void button_Menu_Color_Init()
- {
- this.button_Menu_BasicSet.BackgroundImage = (Image)Properties.Resources.탭메뉴버튼_회색_100_30;
- this.button_Menu_CommBoard.BackgroundImage = (Image)Properties.Resources.탭메뉴버튼_회색_100_30;
- }
- }
- }
|