//singleDev_0
        public void setRowZoneShare(int zonNum) //zonindex 0..60*32
        {
            if (zonNum < 0 || zonNum > Max_SingleZone / 2)
            {
                return;
            }
            SingleZoneUnit sgzUnit    = null;
            string         strSgzunit = string.Empty;

            for (int i = 0; i < Max_SingleZone / 2; i++)
            {
                strSgzunit = string.Format("singleDev_{0}", i);
                sgzUnit    = (SingleZoneUnit)this.FindName(strSgzunit);
                if (sgzUnit != null)
                {
                    if (i >= zonNum)
                    {
                        sgzUnit.IsEnabled = false;
                    }
                    else
                    {
                        sgzUnit.IsEnabled = true;
                    }
                }
            }
        }
        public void setZoneName(int index, string strName)
        {
            SingleZoneUnit sgzUnit    = null;
            string         strSgzunit = string.Empty;

            strSgzunit = string.Format("zoneBtn_{0}", index);
            sgzUnit    = (SingleZoneUnit)this.FindName(strSgzunit);
            if (sgzUnit != null)
            {
                // Debug.WriteLine("update single zone iteral now..{0}", index);
                sgzUnit.zoneName = strName;
            }
        }
        //singleDev_0
        public void initalAllDev() //zonindex 0..60
        {
            //void OnSingleZoneClickEvent(int devindex,int index,byte[] data, RoutedEventArgs e); //which device,which item is click
            SingleZoneUnit sgzUnit    = null;
            string         strSgzunit = string.Empty;

            for (int i = 0; i < Max_SingleZone / 2; i++) //16 devices
            {
                strSgzunit = string.Format("singleDev_{0}", i);
                sgzUnit    = (SingleZoneUnit)this.FindName(strSgzunit);
                if (sgzUnit != null)
                {
                    sgzUnit.m_SingleZoneClickEvent += sgzUnit_m_SingleZoneClickEvent; //new SingleZoneUnit.OnSingleZoneClickEvent(sgzUnit_m_SingleZoneClickEvent);
                }
            }
        }
        public string getZoneName(int index)
        {
            SingleZoneUnit sgzUnit    = null;
            string         strSgzunit = string.Empty;

            strSgzunit = string.Format("zoneBtn_{0}", index);
            sgzUnit    = (SingleZoneUnit)this.FindName(strSgzunit);
            if (sgzUnit != null)
            {
                return(sgzUnit.zoneName);
            }
            else
            {
                return(string.Empty);
            }
        }
        public void updateAllSingleZoneUnit(int rindex)
        {
            SingleZoneUnit sgzUnit = null;
            //  if (rindex > 1) return;
            string strSgzunit = string.Empty;

            for (int i = 0; i < 16; i++)
            {
                strSgzunit = string.Format("zoneBtn_{0}", i);
                sgzUnit    = (SingleZoneUnit)this.FindName(strSgzunit);
                if (sgzUnit != null)
                {
                    // Debug.WriteLine("update single zone iteral now..{0}", i);
                    int tmpi = i;
                    sgzUnit.iTag = COLMAX * rindex + tmpi;
                }
            }
        }
        //singleDev_0
        public void refreshAllSingPorts() //zonindex 0..60*32
        {
            SingleZoneUnit sgzUnit    = null;
            string         strSgzunit = string.Empty;

            for (int i = 0; i < Max_SingleZone / 2; i++) //16 devices
            {
                strSgzunit = string.Format("singleDev_{0}", i);
                sgzUnit    = (SingleZoneUnit)this.FindName(strSgzunit);

                byte H4 = m_singleZoneByte[2 * i + 1];
                byte L8 = m_singleZoneByte[2 * i + 0];

                byte[] mData12 = CUlitity.catsByteHLToByteAry12(H4, L8);
                //   IPProces.printAryByte("fresh with single ports array with devindex  "+i, mData12);
                if (sgzUnit != null)
                {
                    Array.Copy(mData12, sgzUnit.m_singleZone, MaxSinglePort);
                    sgzUnit.refreshAllPorts();
                }
            }
        }
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.singleDev_0 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 2:
                this.singleDev_1 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 3:
                this.singleDev_2 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 4:
                this.singleDev_3 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 5:
                this.singleDev_4 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 6:
                this.singleDev_5 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 7:
                this.singleDev_6 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 8:
                this.singleDev_7 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 9:
                this.singleDev_8 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 10:
                this.singleDev_9 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 11:
                this.singleDev_10 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 12:
                this.singleDev_11 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 13:
                this.singleDev_12 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 14:
                this.singleDev_13 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 15:
                this.singleDev_14 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;

            case 16:
                this.singleDev_15 = ((MatrixSystemEditor.SingleZoneUnit)(target));
                return;
            }
            this._contentLoaded = true;
        }