Exemple #1
0
        private void Io_Display_Output(IO_List _IoList)
        {
            ListView _ListView = ListView_OutputList;

            ImageList dumImgList = new ImageList();

            dumImgList.ImageSize     = new System.Drawing.Size(1, 26);         //리스트 뷰 라인 간격 조절용
            _ListView.SmallImageList = dumImgList;

            _ListView.Items.Clear();

            int nCnt = 0;

            foreach (DeviceNetIO _Io in _IoList.Output)
            {
                nCnt++;
                //no,add,subaddr,type,cable,ioname
                ListViewItem Item = _ListView.Items.Add(nCnt.ToString("000")); //No
                Item.SubItems.Add("M" + _Io.Address.ToString());               //Addr
                Item.SubItems.Add(_Io.Description.ToString());                 //SubAddr
                Item.SubItems.Add(_Io.Cable.ToString());                       //cable
                Item.SubItems.Add(_Io.IO_Name.ToString());                     //IoName
                Item.SubItems.Add(_Io.IsOn.ToString());                        //IoVal
            }
        }
Exemple #2
0
        public void Init(PMacOneBoardCtrl _PmacModule)
        {
            m_PmacModule = _PmacModule;
            m_IoList_All = m_PmacModule.IoList_All;
            Io_Display_Input(m_IoList_All);
            Io_Display_Output(m_IoList_All);

            _ThreadRefreshIO = new Thread(new ThreadStart(RefreshIO));
            _ThreadRefreshIO.IsBackground = true;
            _ThreadRefreshIO.Start();
        }
        private void Io_Display_Output()
        {
            ListView _ListView = ListView_OutputList;

            _ListView.Items.Clear();

            IO_List _List = _PmacCtrl.IoList_All;
            int     nCnt  = 0;

            foreach (DeviceNetIO _Io in _List.Output)
            {
                nCnt++;
                //no,add,subaddr,type,cable,ioname
                ListViewItem Item = _ListView.Items.Add(nCnt.ToString("000")); //No
                Item.SubItems.Add(_Io.Address.ToString());                     //Addr
                Item.SubItems.Add(_Io.Description.ToString());                 //SubAddr
                Item.SubItems.Add(_Io.IO_Type.ToString());                     //Type
                Item.SubItems.Add(_Io.Cable.ToString());                       //cable
                Item.SubItems.Add(_Io.IO_Name.ToString());                     //IoName
            }
        }
Exemple #4
0
        public void LoadIOList()
        {
            try
            {
                string strDir = "Set";
                if (!Directory.Exists(strDir) && strDir != string.Empty)
                {
                    Directory.CreateDirectory(strDir);
                }

                string strFilePath = strDir + "\\" + "PmacIoList_BD" + BoardNumber + ".xml";
                using (FileStream fs = new FileStream(strFilePath, FileMode.Open))
                {
                    XmlSerializer xs = new XmlSerializer(typeof(IO_List));
                    _IoList_All = xs.Deserialize(fs) as IO_List;
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }