Exemple #1
0
 public void CopyTo(CommandINF dev)
 {
     dev.COMMAND_COUNT = this.COMMAND_COUNT;
     dev.COM_NAME      = this.COM_NAME;
     dev.COMMENT       = this.COMMENT;
 }
Exemple #2
0
        //ツリー再構築
        private void DevListREG()
        {
            int i = 0, j = 0, k = 0, n = 0;
            int br = 0;
            //            int cnt = 0;

            CommandSet[, ,] CommandListTemp;
            CommandINF[,] ComListTemp;
            PinSet[,] PinListTemp;

            CommandListTemp = new CommandSet[(int)ConstGui.MAX_DEV_ITEMLIST, (int)ConstGui.MAX_COM_ITEMLIST, (int)ConstGui.MAX_NR_ITEM_IN_COMMANDLIST];
            for (i = 0; i < (int)ConstGui.MAX_DEV_ITEMLIST; i++)
            {
                for (j = 0; j < (int)ConstGui.MAX_COM_ITEMLIST; j++)
                {
                    for (k = 0; k < (int)ConstGui.MAX_NR_ITEM_IN_COMMANDLIST; k++)
                    {
                        CommandListTemp[i, j, k] = new CommandSet();
                    }
                }
            }

            PinListTemp = new PinSet[(int)ConstGui.MAX_DEV_ITEMLIST, (int)ConstGui.MAX_PIN_ITEMLIST];
            for (i = 0; i < (int)ConstGui.MAX_DEV_ITEMLIST; i++)
            {
                for (j = 0; j < (int)ConstGui.MAX_PIN_ITEMLIST; j++)
                {
                    PinListTemp[i, j] = new PinSet();
                }
            }

            ComListTemp = new CommandINF[(int)ConstGui.MAX_DEV_ITEMLIST, (int)ConstGui.MAX_COMINF_ITEMLIST];
            for (i = 0; i < (int)ConstGui.MAX_DEV_ITEMLIST; i++)
            {
                for (j = 0; j < (int)ConstGui.MAX_COMINF_ITEMLIST; j++)
                {
                    ComListTemp[i, j] = new CommandINF();
                }
            }

            if (Common.DEVICE_COUNT == 0) goto nn;

            //DevList 登録時のツリー構造再構築
            for (i = 0; i < lv_DevList.Items.Count; i++)
            {
                for (j = 0, br = 0; j < Common.DEVICE_COUNT; j++)
                {
                    for (k = 0; k < DevListOrg[j].PIN_COUNT; k++)
                    {
                        if ((DevList[i].DEV_NAME == DevListOrg[j].DEV_NAME) || (DevList[i].OLD_NAME == DevListOrg[j].DEV_NAME))
                        {
                            br = 1;
                            PinList[j, k].CopyTo(PinListTemp[i, k]);
                        }
                    }
                    if (br == 1)
                    {
                        DevList[i].PIN_COUNT = DevListOrg[j].PIN_COUNT;
                        break;
                    }
                    else DevList[i].PIN_COUNT = 0;
                }
            }
            for (i = 0; i < lv_DevList.Items.Count; i++)
            {
                for (j = 0, br = 0; j < Common.DEVICE_COUNT; j++)
                {
                    for (k = 0; k < DevListOrg[j].COM_COUNT; k++)
                    {
                        if ((DevList[i].DEV_NAME == DevListOrg[j].DEV_NAME) || (DevList[i].OLD_NAME == DevListOrg[j].DEV_NAME))
                        {
                            br = 1;
                            ComListOrg[j, k].CopyTo(ComListTemp[i, k]);
                        }
                    }
                    if (br == 1)
                    {
                        DevList[i].COM_COUNT = DevListOrg[j].COM_COUNT;
                        DevList[i].COM_NUM = DevListOrg[j].COM_NUM;
                        break;
                    }
                    else
                    {
                        DevList[i].COM_COUNT = 0;
                        DevList[i].COM_NUM = "0";
                    }
                }
            }

            for (i = 0; i < lv_DevList.Items.Count; i++)
            {
                for (j = 0, br = 0; j < Common.DEVICE_COUNT; j++)
                {
                    for (k = 0; k < DevListOrg[j].COM_COUNT; k++)
                    {
                        for (n = 0; n < ComListOrg[j, k].COMMAND_COUNT; n++)
                        {
                            if ((DevList[i].DEV_NAME == DevListOrg[j].DEV_NAME) || (DevList[i].OLD_NAME == DevListOrg[j].DEV_NAME))
                            {
                                br = 1;
                                CommandList[j, k, n].CopyTo(CommandListTemp[i, k, n]);
                            }
                        }
                    }
                    if (br == 1) break;
                }
            }
            nn:
            //Temp→Org
            for (i = 0; i < (int)ConstGui.MAX_DEV_ITEMLIST; i++)
            {
                for (k = 0; k < (int)ConstGui.MAX_PIN_ITEMLIST; k++)
                {
                    PinListTemp[i, k].CopyTo(PinList[i, k]);
                }
                for (k = 0; k < (int)ConstGui.MAX_COM_ITEMLIST; k++)
                {
                    ComListTemp[i, k].CopyTo(ComListOrg[i, k]);
                    for (n = 0; n < (int)ConstGui.MAX_NR_ITEM_IN_COMMANDLIST; n++)
                    {
                        CommandListTemp[i, k, n].CopyTo(CommandList[i, k, n]);
                    }
                }
            }
        }
Exemple #3
0
 public void CopyTo(CommandINF dev)
 {
     dev.COMMAND_COUNT = this.COMMAND_COUNT;
     dev.COM_NAME = this.COM_NAME;
     dev.COMMENT = this.COMMENT;
 }