Пример #1
0
        void OnWriteDataClick(object sender, EventArgs e)
        {
            NodeData      data = (NodeData)(sender as ToolStripItem).Tag;
            Iec61850State iecs = data.GetIecs();

            NodeData[] ndarr = new NodeData[1];
            ndarr[0]           = new NodeData(data.Name);
            ndarr[0].DataType  = data.DataType;
            ndarr[0].DataValue = data.DataValue;
            ndarr[0].DataParam = data.DataParam;
            EditValue    ev = new EditValue(ndarr[0]);
            DialogResult r  = ev.ShowDialog();

            if (r == DialogResult.OK)
            {
                iecs.Send(ndarr, data.Parent.CommAddress, ActionRequested.Write);
                Thread.Sleep(300);
                ndarr    = new NodeData[1];
                ndarr[0] = data;
                iecs.Send(ndarr, data.CommAddress, ActionRequested.Read);
            }
        }
Пример #2
0
        public void GetFile(NodeFile nfi)
        {
            CommAddress ad = new CommAddress();

            NodeBase[] ndarr = new NodeBase[1];
            ndarr[0] = nfi;

            if ((nfi is NodeFile))
            {
                NodeData nd = new NodeData("x");
                nd.DataType  = scsm_MMS_TypeEnum.visible_string;
                nd.DataValue = nfi.Name;
                EditValue ev = new EditValue(nd);
                System.Windows.Forms.DialogResult r = ev.ShowDialog();
                if (r == System.Windows.Forms.DialogResult.OK)
                {
                    ad.Variable = nd.StringValue;
                    nfi.NameSet4Test(ad.Variable);
                }
            }
            nfi.Reset();
            iecs.Send(ndarr, ad, ActionRequested.OpenFile);
        }
Пример #3
0
        void OnFileListClick(object sender, EventArgs e)
        {
            NodeBase      nfi  = (NodeBase)(sender as ToolStripItem).Tag;
            Iec61850State iecs = nfi.GetIecs();
            CommAddress   ad   = new CommAddress();

            NodeBase[] ndarr = new NodeBase[1];
            ndarr[0] = nfi;
            if (!(nfi is NodeFile))
            {
                NodeData nd = new NodeData("x");
                nd.DataType  = scsm_MMS_TypeEnum.visible_string;
                nd.DataValue = "/";
                EditValue    ev = new EditValue(nd);
                DialogResult r  = ev.ShowDialog();
                if (r == DialogResult.OK)
                {
                    ad.Variable = nd.StringValue;
                }
            }

            iecs.Send(ndarr, ad, ActionRequested.GetDirectory);
        }