Example #1
0
 internal void GetImportMenu(System.Windows.Forms.ToolStripItemCollection items)
 {
     if (this.TestIfReadOnlyAndRetrunTrueIfReadOnly())
     {
         return;
     }
     OPCDA.CreateImportMenuItems(items, new EventHandler(CreateImportMenuClick));
 }
 protected CommonDataContract.PollItemValue[] ConvertToPollItemValues(OPCDA.NET.ItemValue[] values)
 {
     List<CommonDataContract.PollItemValue> result = new List<CommonDataContract.PollItemValue>();
     OPCDataContract.OPCItemValue newItemValue;
     foreach (var currentOPCItemValue in values) {
         newItemValue = new OPCDataContract.OPCItemValue(currentOPCItemValue);
         result.Add(newItemValue);
     }
     return result.ToArray();
 }
 public void FillData(OPCDA.NET.ItemValue opcValue)
 {
     ClientHandle = opcValue.ClientHandle;
     Error = opcValue.Error;
     ItemID = opcValue.ItemID;
     MaxAge = opcValue.MaxAge;
     ServerHandle = opcValue.ServerHandle;
     Quality = opcValue.Quality.QualityField.ToString();
     QualitySpecified = opcValue.QualitySpecified;
     if (opcValue.TimestampSpecified)
         Timestamp = opcValue.Timestamp;
     else
         Timestamp = DateTime.Now;
     TimestampSpecified = opcValue.TimestampSpecified;
     Value = opcValue.Value;
 }
Example #4
0
        private void CreateImportMenuClick(object sender, EventArgs e)
        {
            Opc.Ua.ModelCompiler.NodeDesign[] nodes = OPCDA.OnImportMenuItemClick(GetTargetNamespace());
            if (nodes == null)
            {
                return;
            }
            List <BaseTreeNode> arr = new List <BaseTreeNode>();
            bool CancelWasPressed   = false;

            foreach (var item in nodes)
            {
                BaseTreeNode newNode = NodeFactory.Create(item);
                arr.Add(newNode);
                if (item is Opc.Ua.ModelCompiler.InstanceDesign)
                {
                    this.CreateInstanceConfigurations(newNode, CancelWasPressed, out CancelWasPressed);
                }
            }
            this.AddRange(arr.ToArray());
        }
 public OPCItemValue(OPCDA.NET.ItemValue currentOPCItemValue)
 {
     FillData(currentOPCItemValue);
 }
Example #6
0
 void OpcServerShutdownRequested(object sender, OPCDA.NET.ShutdownRequestEventArgs e)
 {
     foreach (string s in this.aliveTags)
     {
         this.opcClient.Write(s, 0);
     }
 }
 void OpcServer_ShutdownRequested(object sender, OPCDA.NET.ShutdownRequestEventArgs e)
 {
     // Todo
     //Environment.Exit(0);
 }