示例#1
0
        public MainForm()
        {
            InitializeComponent();
            m_hmiDataFile_default = new HmiData();
            tbValveName.MaxLength = 15; //VALVE_NAME_MAX_LENTH
            SetConnectStateDisplay();
            m_spPort.ReceivedDataHandle = m_atc.ReceivedFunc;

            SourceFile = System.Windows.Forms.Application.StartupPath + "\\configfile" + "\\hmidata.dat";
            TargetFile = "/hmi/disk/hmidata.dat";
        }
示例#2
0
        private void Openfile(string fileName)
        {
            m_hmiDataFile = new HmiData(fileName);
            if (m_hmiDataFile.m_loaded)
            {
                UTF8Encoding temp = new UTF8Encoding(true);

                PasswordForm dlg = new PasswordForm(temp.GetString(m_hmiDataFile.password));
                if (dlg.ShowDialog() == DialogResult.OK)
                {
                    if (tvPortInfo.Nodes.Count > 0)
                    {
                        tvPortInfo.Nodes.Clear();
                    }
                    SetPortConfigDisplay();
                }
            }
        }
示例#3
0
        private void tsNew_Click(object sender, EventArgs e)
        {
            SaveFileDialog SaveFileDialog1 = new SaveFileDialog();

            SaveFileDialog1.InitialDirectory = System.Windows.Forms.Application.StartupPath + "\\configfile";
            SaveFileDialog1.Filter           = "CFG files (*.dat)|*.dat";
            SaveFileDialog1.FilterIndex      = 1;
            SaveFileDialog1.RestoreDirectory = true;

            if (SaveFileDialog1.ShowDialog() == DialogResult.OK)
            {
                m_hmiDataFile = new HmiData();
                m_hmiDataFile.SaveFile(SaveFileDialog1.FileName);
                if (tvPortInfo.Nodes.Count > 0)
                {
                    tvPortInfo.Nodes.Clear();
                }
                SetPortConfigDisplay();
            }
        }