Beispiel #1
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            if (process == null)
            {
                // validation check
                // IP, Port, ID, Pass
                if (txtIP.Text == "")
                {
                    MessageBox.Show("호스트를 입력하지 않았습니다", "입력에러", MessageBoxButtons.OK);
                    return;
                }
                if (txtPort.Text == "")
                {
                    MessageBox.Show("서버 FTP Port를 입력하지 않았습니다", "입력에러", MessageBoxButtons.OK);
                    return;
                }
                if (txtID.Text == "")
                {
                    MessageBox.Show("User ID를 입력하지 않았습니다", "입력에러", MessageBoxButtons.OK);
                    return;
                }
                if (txtPass.Text == "")
                {
                    MessageBox.Show("User Password를 입력하지 않았습니다", "입력에러", MessageBoxButtons.OK);
                    return;
                }

                process = new ObserverProcess(this);
                process.setHost(txtIP.Text);
                process.setID(txtID.Text);
                process.setPass(txtPass.Text);
                process.setPort(txtPort.Text);

                process.setStHost(txtStIP.Text);
                process.setStPort(txtStPort.Text);
                process.setStCode(txtStCode.Text);

                process.setSndLocalPort(m_sndLocalPort, m_st_rcv_port, m_ft_rcv_port, m_at_rcv_port);

                txtIP.ReadOnly     = true;
                txtPort.ReadOnly   = true;
                txtID.ReadOnly     = true;
                txtPass.ReadOnly   = true;
                txtStCode.ReadOnly = true;
                btnStart.Enabled   = false;
                btnStop.Enabled    = true;


                process.start();

                statusPanel.Text        = "Process started. Action Start....";
                statusPanel.ToolTipText = "Last Activity";

                btnStart.BackgroundImage       = Properties.Resources.btn_start_sm_g;
                btnStart.BackgroundImageLayout = ImageLayout.Stretch;
                btnStop.BackgroundImage        = Properties.Resources.btn_stop_sm;
                btnStop.BackgroundImageLayout  = ImageLayout.Stretch;
            }
        }
Beispiel #2
0
        private void btnStop_Click(object sender, EventArgs e)
        {
            statusPanel.Text        = "Process stoped. Action stop....";
            statusPanel.ToolTipText = "Last Activity";

            if (process != null)
            {
                process.abort();
                process = null;
            }
            txtIP.ReadOnly   = false;
            txtPort.ReadOnly = false;
            txtID.ReadOnly   = false;
            txtPass.ReadOnly = false;
            btnStart.Enabled = true;
            btnStop.Enabled  = false;

            btnStart.BackgroundImage       = Properties.Resources.btn_start_sm;
            btnStart.BackgroundImageLayout = ImageLayout.Stretch;
            btnStop.BackgroundImage        = Properties.Resources.btn_stop_sm_g;
            btnStop.BackgroundImageLayout  = ImageLayout.Stretch;
        }
 public AlarmProcess(ObserverProcess m)
 {
     lstAlaram = new List <AlmInfo>();
     log       = new LogCls();
     main      = m;
 }
Beispiel #4
0
        private const int cCaption = 62;  // 2;   // Caption bar height;

        public WindClientForm()
        {
            InitializeComponent();

            //this.Text = "";
            //this.ControlBox = false;

            this.FormBorderStyle = FormBorderStyle.None;
            this.DoubleBuffered  = true;
            this.SetStyle(ControlStyles.ResizeRedraw, true);


            process = null;

            myIniFile = new IniFile(@"D:\WindLidarClient.ini");

            txtIP.Text   = myIniFile.Read("FTP_IP");
            txtPort.Text = myIniFile.Read("FTP_PORT");
            txtID.Text   = myIniFile.Read("FTP_ID");
            txtPass.Text = myIniFile.Read("FTP_PASS");

            txtStIP.Text   = myIniFile.Read("ST_IP");
            txtStPort.Text = myIniFile.Read("ST_PORT");

            m_site_code    = myIniFile.Read("ST_CODE");
            txtStCode.Text = m_site_code;

            m_sndLocalPort   = myIniFile.Read("SndLocalPort");
            m_st_rcv_port    = System.Convert.ToInt32(myIniFile.Read("ST_RCV_PORT"));
            m_ft_rcv_port    = System.Convert.ToInt32(myIniFile.Read("FT_RCV_PORT"));
            m_at_rcv_port    = System.Convert.ToInt32(myIniFile.Read("AT_RCV_PORT"));
            btnStart.Enabled = true;
            btnStop.Enabled  = false;

            createStatusBar();

            //panelClose.BackgroundImage = Properties.Resources.close;
            //panelClose.BackgroundImageLayout = ImageLayout.Stretch;

            //panelHide.BackgroundImage = Properties.Resources.hide;
            //panelHide.BackgroundImageLayout = ImageLayout.Stretch;


            lblSmall.BackColor = System.Drawing.ColorTranslator.FromHtml("#32709f");  // Color.DodgerBlue;
            lblSmall.ForeColor = Color.White;
            lblSmall.Cursor    = Cursors.Hand;
            lblClose.BackColor = System.Drawing.ColorTranslator.FromHtml("#32709f");  //  Color.DodgerBlue;
            lblClose.ForeColor = Color.White;
            lblClose.Cursor    = Cursors.Hand;



            lblTitle.BackColor = System.Drawing.ColorTranslator.FromHtml("#32709f");  //  Color.DodgerBlue;
            lblTitle.ForeColor = Color.White;

            lblTitle2.BackColor = System.Drawing.ColorTranslator.FromHtml("#32709f");  //  Color.DodgerBlue;
            lblTitle2.ForeColor = Color.White;

            btnStart.Cursor = Cursors.Hand;
            btnStop.Cursor  = Cursors.Hand;


            //this.BackColor = Color.White;

            this.BackColor = Color.FromArgb(255, 255, 250);

            // image load
            btnStart.Text                  = "";
            btnStop.Text                   = "";
            btnStart.BackgroundImage       = Properties.Resources.btn_start_sm;
            btnStart.BackgroundImageLayout = ImageLayout.Stretch;
            btnStop.BackgroundImage        = Properties.Resources.btn_stop_sm_g;
            btnStop.BackgroundImageLayout  = ImageLayout.Stretch;

            //lblSmall.Text = "";
            //lblClose.Text = "";
            //lblSmall.BackgroundImage = Properties.Resources.btn__;
            //lblSmall.BackgroundImageLayout = ImageLayout.Stretch;
            //lblClose.BackgroundImage = Properties.Resources.btn_x;
            //lblClose.BackgroundImageLayout = ImageLayout.Stretch;
        }