Beispiel #1
0
        protected void MuteDevice(UId deviceId)
        {
            DiscoveryMute.Request mute = new DiscoveryMute.Request();
            mute.Header.DestinationId = deviceId;

            SendPacket(mute);
        }
 protected override void ReadData(RdmBinaryReader data)
 {
     Id            = data.ReadUId();
     EndpointID    = data.ReadNetwork16();
     ControlFields = data.ReadNetwork16();
     BindingId     = data.ReadUId();
 }
Beispiel #3
0
        public void StartDiscovery(bool fullDiscovery)
        {
            if (Status == DiscoveryStatus.Running)
            {
                throw new InvalidOperationException("A previous discovery is still in progress. Please either stop that discovery or wait for it to complete.");
            }

            searchRangeStart = UId.MaxValue;
            searchRangeEnd   = UId.MinValue;

            Status = DiscoveryStatus.Running;

            if (fullDiscovery)
            {
                //Clear all known devices from the device table.
                deviceTable.Clear();
            }
            else
            {
                //Mute any known devices.
                List <UId> knownDevices = new List <UId>(deviceTable);
                deviceTable.Clear();        //Clear the device table as the mute reply will re-add the device if it still exists.

                //Send a mute packet to all known devices.
                foreach (UId id in deviceTable)
                {
                    MuteDevice(id);
                }
            }

            //Broadcast a discovery message to all devices.
            Discover();
        }
Beispiel #4
0
        public bool Equals([AllowNull] Indicator other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Mode == other.Mode && Mode != null && other.Mode != null && Mode.Equals(other.Mode)) &&
                   (Value == other.Value && Value != null && other.Value != null && Value.Equals(other.Value)) &&
                   (Align == other.Align && Align != null && other.Align != null && Align.Equals(other.Align)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (Title == other.Title && Title != null && other.Title != null && Title.Equals(other.Title)) &&
                   (Number == other.Number && Number != null && other.Number != null && Number.Equals(other.Number)) &&
                   (Delta == other.Delta && Delta != null && other.Delta != null && Delta.Equals(other.Delta)) &&
                   (Gauge == other.Gauge && Gauge != null && other.Gauge != null && Gauge.Equals(other.Gauge)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)));
        }
Beispiel #5
0
        public void SendRdm(RdmPacket packet, RdmEndPoint targetAddress, UId targetId, UId sourceId)
        {
            //Queue this packet for sending.
            RegisterTransaction(packet, targetAddress, targetId);

            // socket.SendRdm(packet, targetAddress, targetId, sourceId);
        }
Beispiel #6
0
        public void SendRdm(RdmPacket packet, RdmEndPoint targetAddress, UId targetId, UId sourceId)
        {
            //Fill in addition details
            packet.Header.SourceId      = sourceId;
            packet.Header.DestinationId = targetId;

            //Sub Devices
            if (targetId is SubDeviceUId)
            {
                packet.Header.SubDevice = ((SubDeviceUId)targetId).SubDeviceId;
            }

            //Create Rdm Packet
            using (var rdmData = new MemoryStream())
            {
                var rdmWriter = new RdmBinaryWriter(rdmData);

                //Write the RDM packet
                RdmPacket.WritePacket(packet, rdmWriter);

                //Write the checksum
                rdmWriter.WriteNetwork((short)(RdmPacket.CalculateChecksum(rdmData.GetBuffer()) + (int)RdmVersions.SubMessage + (int)DmxStartCodes.RDM));

                //Create sACN Packet
                var rdmPacket = new ArtRdmPacket();
                rdmPacket.Address      = (byte)targetAddress.Universe;
                rdmPacket.SubStartCode = (byte)RdmVersions.SubMessage;
                rdmPacket.RdmData      = rdmData.GetBuffer();

                Send(rdmPacket, targetAddress);

                RdmPacketSent?.Invoke(this, new NewPacketEventArgs <RdmPacket>(new IPEndPoint(targetAddress.IpAddress, Port), packet));
            }
        }
Beispiel #7
0
        public bool Equals([AllowNull] ParCoords other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Domain == other.Domain && Domain != null && other.Domain != null && Domain.Equals(other.Domain)) &&
                   (LabelAngle == other.LabelAngle && LabelAngle != null && other.LabelAngle != null && LabelAngle.Equals(other.LabelAngle)) &&
                   (LabelSide == other.LabelSide && LabelSide != null && other.LabelSide != null && LabelSide.Equals(other.LabelSide)) &&
                   (LabelFont == other.LabelFont && LabelFont != null && other.LabelFont != null && LabelFont.Equals(other.LabelFont)) &&
                   (TickFont == other.TickFont && TickFont != null && other.TickFont != null && TickFont.Equals(other.TickFont)) &&
                   (RangeFont == other.RangeFont && RangeFont != null && other.RangeFont != null && RangeFont.Equals(other.RangeFont)) &&
                   (Equals(Dimensions, other.Dimensions) || Dimensions != null && other.Dimensions != null && Dimensions.SequenceEqual(other.Dimensions)) &&
                   (Line == other.Line && Line != null && other.Line != null && Line.Equals(other.Line)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)));
        }
        public void Start()
        {
            if (acnSocket == null || !acnSocket.PortOpen)
            {
                acnSocket = new RdmNetSocket(UId.NewUId(0xFF), Guid.NewGuid(), "RDM Snoop");
                acnSocket.NewRdmPacket += acnSocket_NewRdmPacket;
                acnSocket.Open(new IPEndPoint(LocalAdapter, 0));
            }

#if SLP_Discovery
            slpUser = new SlpUserAgent("ACN-DEFAULT");
            slpUser.NetworkAdapter = localAdapter;
            slpUser.ServiceFound  += new EventHandler <ServiceFoundEventArgs>(slpUser_ServiceFound);


            slpUser.Open();
            slpUser.Find("service:rdmnet-device");
#endif

#if mDNS_Discovery
            dnsSD = new ServiceBrowser();
            dnsSD.ServiceAdded += dnsSD_ServiceAdded;
            dnsSD.Browse("_rdmnet._udp", "local");
#endif
        }
Beispiel #9
0
        public void SendRdm(List <RdmPacket> packets, RdmEndPoint targetAddress, UId targetId)
        {
            if (packets.Count < 1)
            {
                throw new ArgumentException("Rdm packets list is empty.");
            }

            RdmPacket primaryPacket = packets[0];

            //Create sACN Packet
            ArtRdmSubPacket rdmPacket = new ArtRdmSubPacket();

            rdmPacket.DeviceId    = targetId;
            rdmPacket.RdmVersion  = (byte)RdmVersions.SubMessage;
            rdmPacket.Command     = primaryPacket.Header.Command;
            rdmPacket.ParameterId = primaryPacket.Header.ParameterId;
            rdmPacket.SubDevice   = (short)primaryPacket.Header.SubDevice;
            rdmPacket.SubCount    = (short)packets.Count;

            MemoryStream    rdmData    = new MemoryStream();
            RdmBinaryWriter dataWriter = new RdmBinaryWriter(rdmData);

            foreach (RdmPacket item in packets)
            {
                RdmPacket.WritePacket(item, dataWriter, true);
            }

            rdmPacket.RdmData = rdmData.ToArray();

            Send(rdmPacket, targetAddress);
        }
Beispiel #10
0
        internal List <RdmRouteBinding> GetTransportsRoutes(UId targetId)
        {
            List <RdmRouteBinding> transportsToUse = new List <RdmRouteBinding>();

            if (targetId == UId.Broadcast)
            {
                lock (transports)
                {
                    transportsToUse.AddRange(transports.Values);
                }
            }
            else
            {
                lock (deviceTable)
                {
                    //Obtain routed transport.
                    RdmRouteBinding transportRoute;
                    if (deviceTable.TryGetValue(targetId, out transportRoute))
                    {
                        transportsToUse.Add(transportRoute);
                    }
                }
            }

            return(transportsToUse);
        }
Beispiel #11
0
        public bool Equals([AllowNull] HeatMapGl other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(Z, other.Z) || Z != null && other.Z != null && Z.SequenceEqual(other.Z)) &&
                   (Equals(X, other.X) || X != null && other.X != null && X.SequenceEqual(other.X)) &&
                   (X0 == other.X0 && X0 != null && other.X0 != null && X0.Equals(other.X0)) &&
                   (DX == other.DX && DX != null && other.DX != null && DX.Equals(other.DX)) &&
                   (Equals(Y, other.Y) || Y != null && other.Y != null && Y.SequenceEqual(other.Y)) &&
                   (Y0 == other.Y0 && Y0 != null && other.Y0 != null && Y0.Equals(other.Y0)) &&
                   (Dy == other.Dy && Dy != null && other.Dy != null && Dy.Equals(other.Dy)) &&
                   (Equals(Text, other.Text) || Text != null && other.Text != null && Text.SequenceEqual(other.Text)) &&
                   (Transpose == other.Transpose && Transpose != null && other.Transpose != null && Transpose.Equals(other.Transpose)) &&
                   (XType == other.XType && XType != null && other.XType != null && XType.Equals(other.XType)) &&
                   (YType == other.YType && YType != null && other.YType != null && YType.Equals(other.YType)) &&
                   (ZAuto == other.ZAuto && ZAuto != null && other.ZAuto != null && ZAuto.Equals(other.ZAuto)) &&
                   (ZMin == other.ZMin && ZMin != null && other.ZMin != null && ZMin.Equals(other.ZMin)) &&
                   (ZMax == other.ZMax && ZMax != null && other.ZMax != null && ZMax.Equals(other.ZMax)) &&
                   (ZMid == other.ZMid && ZMid != null && other.ZMid != null && ZMid.Equals(other.ZMid)) &&
                   (ColorScale == other.ColorScale && ColorScale != null && other.ColorScale != null && ColorScale.Equals(other.ColorScale)) &&
                   (AutoColorScale == other.AutoColorScale && AutoColorScale != null && other.AutoColorScale != null && AutoColorScale.Equals(other.AutoColorScale)) &&
                   (ReverseScale == other.ReverseScale && ReverseScale != null && other.ReverseScale != null && ReverseScale.Equals(other.ReverseScale)) &&
                   (ShowScale == other.ShowScale && ShowScale != null && other.ShowScale != null && ShowScale.Equals(other.ShowScale)) &&
                   (ColorBar == other.ColorBar && ColorBar != null && other.ColorBar != null && ColorBar.Equals(other.ColorBar)) &&
                   (ColorAxis == other.ColorAxis && ColorAxis != null && other.ColorAxis != null && ColorAxis.Equals(other.ColorAxis)) &&
                   (XAxis == other.XAxis && XAxis != null && other.XAxis != null && XAxis.Equals(other.XAxis)) &&
                   (YAxis == other.YAxis && YAxis != null && other.YAxis != null && YAxis.Equals(other.YAxis)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (ZSrc == other.ZSrc && ZSrc != null && other.ZSrc != null && ZSrc.Equals(other.ZSrc)) &&
                   (XSrc == other.XSrc && XSrc != null && other.XSrc != null && XSrc.Equals(other.XSrc)) &&
                   (YSrc == other.YSrc && YSrc != null && other.YSrc != null && YSrc.Equals(other.YSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)));
        }
Beispiel #12
0
        public RdmDeviceBroker(RdmSocket socket, UId id, RdmAddress address)
        {
            Id          = id;
            Address     = address;
            this.socket = socket;

            socket.NewRdmPacket += new EventHandler <NewPacketEventArgs <RdmPacket> >(socket_NewRdmPacket);
        }
Beispiel #13
0
        public RdmNetSocket(UId rdmId, Guid sourceId, string sourceName)
            : base(sourceId)
        {
            RdmSourceId = rdmId;
            SourceName  = sourceName;

            RegisterProtocolFilter(this);
        }
Beispiel #14
0
 public Display()
 {
     InitializeComponent();
     Messager.Instance.SubScribe(this);
     _history = new ObservableCollection <string>();
     HistoryContext.ItemsSource = _history;
     MessageReciverID           = new UId();
 }
 protected override void ReadData(RdmBinaryReader data)
 {
     ControlField = data.ReadNetwork16();
     if (Header.ParameterDataLength > 2)
     {
         BindingId = data.ReadUId();
     }
 }
Beispiel #16
0
        public bool Equals([AllowNull] Ohlc other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) &&
                   (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (SelectedPoints == other.SelectedPoints && SelectedPoints != null && other.SelectedPoints != null && SelectedPoints.Equals(other.SelectedPoints)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(X, other.X) || X != null && other.X != null && X.SequenceEqual(other.X)) &&
                   (Equals(Open, other.Open) || Open != null && other.Open != null && Open.SequenceEqual(other.Open)) &&
                   (Equals(High, other.High) || High != null && other.High != null && High.SequenceEqual(other.High)) &&
                   (Equals(Low, other.Low) || Low != null && other.Low != null && Low.SequenceEqual(other.Low)) &&
                   (Equals(Close, other.Close) || Close != null && other.Close != null && Close.SequenceEqual(other.Close)) &&
                   (Line == other.Line && Line != null && other.Line != null && Line.Equals(other.Line)) &&
                   (Increasing == other.Increasing && Increasing != null && other.Increasing != null && Increasing.Equals(other.Increasing)) &&
                   (Decreasing == other.Decreasing && Decreasing != null && other.Decreasing != null && Decreasing.Equals(other.Decreasing)) &&
                   (Text == other.Text && Text != null && other.Text != null && Text.Equals(other.Text)) &&
                   (Equals(TextArray, other.TextArray) || TextArray != null && other.TextArray != null && TextArray.SequenceEqual(other.TextArray)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) &&
                   (TickWidth == other.TickWidth && TickWidth != null && other.TickWidth != null && TickWidth.Equals(other.TickWidth)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (XCalendar == other.XCalendar && XCalendar != null && other.XCalendar != null && XCalendar.Equals(other.XCalendar)) &&
                   (XAxis == other.XAxis && XAxis != null && other.XAxis != null && XAxis.Equals(other.XAxis)) &&
                   (YAxis == other.YAxis && YAxis != null && other.YAxis != null && YAxis.Equals(other.YAxis)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (XSrc == other.XSrc && XSrc != null && other.XSrc != null && XSrc.Equals(other.XSrc)) &&
                   (OpenSrc == other.OpenSrc && OpenSrc != null && other.OpenSrc != null && OpenSrc.Equals(other.OpenSrc)) &&
                   (HighSrc == other.HighSrc && HighSrc != null && other.HighSrc != null && HighSrc.Equals(other.HighSrc)) &&
                   (LowSrc == other.LowSrc && LowSrc != null && other.LowSrc != null && LowSrc.Equals(other.LowSrc)) &&
                   (CloseSrc == other.CloseSrc && CloseSrc != null && other.CloseSrc != null && CloseSrc.Equals(other.CloseSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)));
        }
Beispiel #17
0
        public void Init()
        {
            UId = Guid.NewGuid();
            Id  = UId.ToString("D");

            //Image = new BitmapImage(new Uri("pack://application:,,,/Shell;component/Resources/Userpic.png"));
            //Image = AppFile.Default.UserImage;
            //ImageBytes = AppFile.Default.ImageBytes;
        }
Beispiel #18
0
 public Transaction(int transactionId, RdmPacket packet, RdmEndPoint address, UId id)
 {
     Id = transactionId;
     TransactionNumber = (byte)(transactionId % 255);
     Packet            = packet;
     TargetAddress     = address;
     TargetId          = id;
     Attempts          = 0;
     LastAttempt       = DateTime.MinValue;
 }
Beispiel #19
0
        public RdmDeviceBroker(IRdmSocket socket, UId id, RdmEndPoint address)
        {
            Id          = id;
            Address     = address;
            this.socket = socket;

            RegisterHandlers(this);

            socket.NewRdmPacket += new EventHandler <NewPacketEventArgs <RdmPacket> >(socket_NewRdmPacket);
        }
Beispiel #20
0
        public void SendRdm(RdmPacket packet, RdmEndPoint targetAddress, UId targetId, UId sourceId)
        {
            List <RdmRouteBinding> transportsToUse = router.GetTransportsRoutes(targetId);

            //Send the packet on all transports.
            foreach (RdmRouteBinding binding in transportsToUse)
            {
                binding.Transport.Socket.SendRdm(packet, targetAddress, targetId, sourceId);
            }
        }
Beispiel #21
0
 /// <inheritdoc />
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         if (Type != null) hashCode = hashCode * 59 + Type.GetHashCode();
         if (Visible != null) hashCode = hashCode * 59 + Visible.GetHashCode();
         if (Opacity != null) hashCode = hashCode * 59 + Opacity.GetHashCode();
         if (Name != null) hashCode = hashCode * 59 + Name.GetHashCode();
         if (UId != null) hashCode = hashCode * 59 + UId.GetHashCode();
         if (Ids != null) hashCode = hashCode * 59 + Ids.GetHashCode();
         if (CustomData != null) hashCode = hashCode * 59 + CustomData.GetHashCode();
         if (Meta != null) hashCode = hashCode * 59 + Meta.GetHashCode();
         if (MetaArray != null) hashCode = hashCode * 59 + MetaArray.GetHashCode();
         if (HoverInfo != null) hashCode = hashCode * 59 + HoverInfo.GetHashCode();
         if (HoverInfoArray != null) hashCode = hashCode * 59 + HoverInfoArray.GetHashCode();
         if (HoverLabel != null) hashCode = hashCode * 59 + HoverLabel.GetHashCode();
         if (Stream != null) hashCode = hashCode * 59 + Stream.GetHashCode();
         if (Transforms != null) hashCode = hashCode * 59 + Transforms.GetHashCode();
         if (UiRevision != null) hashCode = hashCode * 59 + UiRevision.GetHashCode();
         if (Z != null) hashCode = hashCode * 59 + Z.GetHashCode();
         if (X != null) hashCode = hashCode * 59 + X.GetHashCode();
         if (X0 != null) hashCode = hashCode * 59 + X0.GetHashCode();
         if (DX != null) hashCode = hashCode * 59 + DX.GetHashCode();
         if (Y != null) hashCode = hashCode * 59 + Y.GetHashCode();
         if (Y0 != null) hashCode = hashCode * 59 + Y0.GetHashCode();
         if (Dy != null) hashCode = hashCode * 59 + Dy.GetHashCode();
         if (Text != null) hashCode = hashCode * 59 + Text.GetHashCode();
         if (Transpose != null) hashCode = hashCode * 59 + Transpose.GetHashCode();
         if (XType != null) hashCode = hashCode * 59 + XType.GetHashCode();
         if (YType != null) hashCode = hashCode * 59 + YType.GetHashCode();
         if (ZAuto != null) hashCode = hashCode * 59 + ZAuto.GetHashCode();
         if (ZMin != null) hashCode = hashCode * 59 + ZMin.GetHashCode();
         if (ZMax != null) hashCode = hashCode * 59 + ZMax.GetHashCode();
         if (ZMid != null) hashCode = hashCode * 59 + ZMid.GetHashCode();
         if (ColorScale != null) hashCode = hashCode * 59 + ColorScale.GetHashCode();
         if (AutoColorScale != null) hashCode = hashCode * 59 + AutoColorScale.GetHashCode();
         if (ReverseScale != null) hashCode = hashCode * 59 + ReverseScale.GetHashCode();
         if (ShowScale != null) hashCode = hashCode * 59 + ShowScale.GetHashCode();
         if (ColorBar != null) hashCode = hashCode * 59 + ColorBar.GetHashCode();
         if (ColorAxis != null) hashCode = hashCode * 59 + ColorAxis.GetHashCode();
         if (XAxis != null) hashCode = hashCode * 59 + XAxis.GetHashCode();
         if (YAxis != null) hashCode = hashCode * 59 + YAxis.GetHashCode();
         if (IdsSrc != null) hashCode = hashCode * 59 + IdsSrc.GetHashCode();
         if (CustomDataSrc != null) hashCode = hashCode * 59 + CustomDataSrc.GetHashCode();
         if (MetaSrc != null) hashCode = hashCode * 59 + MetaSrc.GetHashCode();
         if (HoverInfoSrc != null) hashCode = hashCode * 59 + HoverInfoSrc.GetHashCode();
         if (ZSrc != null) hashCode = hashCode * 59 + ZSrc.GetHashCode();
         if (XSrc != null) hashCode = hashCode * 59 + XSrc.GetHashCode();
         if (YSrc != null) hashCode = hashCode * 59 + YSrc.GetHashCode();
         if (TextSrc != null) hashCode = hashCode * 59 + TextSrc.GetHashCode();
         return hashCode;
     }
 }
Beispiel #22
0
        /// <summary>
        /// Gets the transport binding for a specific device.
        /// </summary>
        /// <remarks>
        /// Each device will have a transport binding which determines the transport used to comunicate with that device.
        /// </remarks>
        /// <param name="targetId">The ID of the device we wish to get the binding for.</param>
        /// <returns>The transport binding for the specified device.</returns>
        public RdmRouteBinding GetBindingForDevice(UId targetId)
        {
            if (targetId == UId.Broadcast)
            {
                throw new InvalidOperationException("Target device UId can not be broadcast.");
            }

            RdmRouteBinding route = GetTransportsRoutes(targetId).FirstOrDefault();

            return(route);
        }
Beispiel #23
0
        public bool Equals([AllowNull] Splom other)
        {
            if (other == null)
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return((Type == other.Type && Type != null && other.Type != null && Type.Equals(other.Type)) &&
                   (Visible == other.Visible && Visible != null && other.Visible != null && Visible.Equals(other.Visible)) &&
                   (ShowLegend == other.ShowLegend && ShowLegend != null && other.ShowLegend != null && ShowLegend.Equals(other.ShowLegend)) &&
                   (LegendGroup == other.LegendGroup && LegendGroup != null && other.LegendGroup != null && LegendGroup.Equals(other.LegendGroup)) &&
                   (Name == other.Name && Name != null && other.Name != null && Name.Equals(other.Name)) &&
                   (UId == other.UId && UId != null && other.UId != null && UId.Equals(other.UId)) &&
                   (Equals(Ids, other.Ids) || Ids != null && other.Ids != null && Ids.SequenceEqual(other.Ids)) &&
                   (Equals(CustomData, other.CustomData) || CustomData != null && other.CustomData != null && CustomData.SequenceEqual(other.CustomData)) &&
                   (Meta == other.Meta && Meta != null && other.Meta != null && Meta.Equals(other.Meta)) &&
                   (Equals(MetaArray, other.MetaArray) || MetaArray != null && other.MetaArray != null && MetaArray.SequenceEqual(other.MetaArray)) &&
                   (SelectedPoints == other.SelectedPoints && SelectedPoints != null && other.SelectedPoints != null && SelectedPoints.Equals(other.SelectedPoints)) &&
                   (HoverInfo == other.HoverInfo && HoverInfo != null && other.HoverInfo != null && HoverInfo.Equals(other.HoverInfo)) &&
                   (Equals(HoverInfoArray, other.HoverInfoArray) || HoverInfoArray != null && other.HoverInfoArray != null && HoverInfoArray.SequenceEqual(other.HoverInfoArray)) &&
                   (HoverLabel == other.HoverLabel && HoverLabel != null && other.HoverLabel != null && HoverLabel.Equals(other.HoverLabel)) &&
                   (Stream == other.Stream && Stream != null && other.Stream != null && Stream.Equals(other.Stream)) &&
                   (Equals(Transforms, other.Transforms) || Transforms != null && other.Transforms != null && Transforms.SequenceEqual(other.Transforms)) &&
                   (UiRevision == other.UiRevision && UiRevision != null && other.UiRevision != null && UiRevision.Equals(other.UiRevision)) &&
                   (Equals(Dimensions, other.Dimensions) || Dimensions != null && other.Dimensions != null && Dimensions.SequenceEqual(other.Dimensions)) &&
                   (Text == other.Text && Text != null && other.Text != null && Text.Equals(other.Text)) &&
                   (Equals(TextArray, other.TextArray) || TextArray != null && other.TextArray != null && TextArray.SequenceEqual(other.TextArray)) &&
                   (HoverText == other.HoverText && HoverText != null && other.HoverText != null && HoverText.Equals(other.HoverText)) &&
                   (Equals(HoverTextArray, other.HoverTextArray) || HoverTextArray != null && other.HoverTextArray != null && HoverTextArray.SequenceEqual(other.HoverTextArray)) &&
                   (HoverTemplate == other.HoverTemplate && HoverTemplate != null && other.HoverTemplate != null && HoverTemplate.Equals(other.HoverTemplate)) &&
                   (Equals(HoverTemplateArray, other.HoverTemplateArray) ||
                    HoverTemplateArray != null && other.HoverTemplateArray != null && HoverTemplateArray.SequenceEqual(other.HoverTemplateArray)) &&
                   (Marker == other.Marker && Marker != null && other.Marker != null && Marker.Equals(other.Marker)) &&
                   (Equals(XAxes, other.XAxes) || XAxes != null && other.XAxes != null && XAxes.SequenceEqual(other.XAxes)) &&
                   (Equals(YAxes, other.YAxes) || YAxes != null && other.YAxes != null && YAxes.SequenceEqual(other.YAxes)) &&
                   (Diagonal == other.Diagonal && Diagonal != null && other.Diagonal != null && Diagonal.Equals(other.Diagonal)) &&
                   (ShowUpperHalf == other.ShowUpperHalf && ShowUpperHalf != null && other.ShowUpperHalf != null && ShowUpperHalf.Equals(other.ShowUpperHalf)) &&
                   (ShowLowerHalf == other.ShowLowerHalf && ShowLowerHalf != null && other.ShowLowerHalf != null && ShowLowerHalf.Equals(other.ShowLowerHalf)) &&
                   (Selected == other.Selected && Selected != null && other.Selected != null && Selected.Equals(other.Selected)) &&
                   (Unselected == other.Unselected && Unselected != null && other.Unselected != null && Unselected.Equals(other.Unselected)) &&
                   (Opacity == other.Opacity && Opacity != null && other.Opacity != null && Opacity.Equals(other.Opacity)) &&
                   (IdsSrc == other.IdsSrc && IdsSrc != null && other.IdsSrc != null && IdsSrc.Equals(other.IdsSrc)) &&
                   (CustomDataSrc == other.CustomDataSrc && CustomDataSrc != null && other.CustomDataSrc != null && CustomDataSrc.Equals(other.CustomDataSrc)) &&
                   (MetaSrc == other.MetaSrc && MetaSrc != null && other.MetaSrc != null && MetaSrc.Equals(other.MetaSrc)) &&
                   (HoverInfoSrc == other.HoverInfoSrc && HoverInfoSrc != null && other.HoverInfoSrc != null && HoverInfoSrc.Equals(other.HoverInfoSrc)) &&
                   (TextSrc == other.TextSrc && TextSrc != null && other.TextSrc != null && TextSrc.Equals(other.TextSrc)) &&
                   (HoverTextSrc == other.HoverTextSrc && HoverTextSrc != null && other.HoverTextSrc != null && HoverTextSrc.Equals(other.HoverTextSrc)) &&
                   (HoverTemplateSrc == other.HoverTemplateSrc && HoverTemplateSrc != null && other.HoverTemplateSrc != null && HoverTemplateSrc.Equals(other.HoverTemplateSrc)));
        }
Beispiel #24
0
        public UIElement CreateLink()
        {
            if (_element == null)
            {
                DrawLinkArrow(StartPoint, EndPoint);
                _element     = Path;
                _element.Uid = UId.ToString("D");
            }

            return(_element);
        }
Beispiel #25
0
        public void SendRdm(RdmPacket packet, RdmEndPoint targetAddress, UId targetId)
        {
            if (BlockRDM)
            {
                return;
            }

            //Queue this packet for sending.
            RegisterTransaction(packet, targetAddress, targetId);

            //socket.SendRdm(packet, targetAddress, targetId);
        }
Beispiel #26
0
 void slpUser_ServiceFound(object sender, ServiceFoundEventArgs e)
 {
     foreach (UrlEntry url in e.Urls)
     {
         RdmEndPoint controlEndpoint = new RdmEndPoint(new IPEndPoint(e.Address.Address, RdmNetSocket.RdmNetPort), 0)
         {
             Id = UId.ParseUrl(url.Url)
         };
         ControlEndpoints.Add(controlEndpoint);
         DiscoverEndpoints(controlEndpoint);
     }
 }
Beispiel #27
0
        public HealthCheckedTcpSocket(Socket socket, UId rdmId, Guid senderId, string sourceName)
            : base(rdmId, senderId, sourceName)
        {
            this.socket = socket;

            heartbeatTimer  = new Timer(new TimerCallback(Heartbeat));
            heartbeatFilter = new HeartbeatProtocolFilter(this);

            NewRdmPacket += HealthCheckedTcpSocket_NewRdmPacket;

            RegisterProtocolFilter(heartbeatFilter);
        }
Beispiel #28
0
        private void AddDevice(UId id, IPAddress address)
        {
            if (!devices.ContainsKey(id))
            {
                RdmDeviceModel device = new RdmDeviceModel(new TreeNode(id.ToString()), acnSocket, id, address);
                devices[id] = device;
                rdmDevices.Nodes.Add(device.Node);

                device.PortsChanged += new EventHandler(device_PortsChanged);
                device.Identify();
            }
        }
Beispiel #29
0
        public RdmDeviceModel(TreeNode node, IEnumerable <IRdmSocket> socket, UId id, RdmEndPoint address)
        {
            CreateHandle();

            broker = new RdmDeviceBroker(socket, id, address);

            Node     = node;
            Node.Tag = this;

            broker.PropertyChanged += new System.ComponentModel.PropertyChangedEventHandler(RdmDeviceModel_PropertyChanged);

            UpdateNodeName();
        }
Beispiel #30
0
        public void Start()
        {
            if (socket == null || !socket.PortOpen)
            {
                LocalAdapter = localAdapter;

                socket            = new ArtNetSocket(UId.NewUId(32));
                socket.NewPacket += new EventHandler <Acn.Sockets.NewPacketEventArgs <ArtNetPacket> >(socket_NewPacket);
                socket.Open(LocalAdapter, SubnetMask);

                Discover(DiscoveryType.GatewayDiscovery);
            }
        }