public report(string xmlReply, string path, string DocElement)
            {
                XmlDocument _xDoc = GetXmlDocument(xmlReply);

                if (Convert.ToString(_xDoc.SelectSingleNode("/reply/readTagIDs").InnerText) == "")
                {
                    Console.WriteLine("Kein Tag gefunden!");
                }
                else
                {
                    string _tag = Convert.ToString(_xDoc.SelectSingleNode("/reply/readTagIDs/returnValue").InnerXml);

                    // split
                    string[] split_version = _tag.Split(new string[] { "<tag>" }, StringSplitOptions.None);


                    foreach (string _t in split_version)  //<tag> Element hinzufügen
                    {
                        if (_t.Length < 2)
                        {
                            continue;
                        }
                        string x = "<tag>" + _t;
                        this.tag.Add(x);
                    }

                    foreach (string _t in tag)
                    {
                        string fullPath = "/tag/";

                        XmlDocument _xDocTag = GetXmlDocument(_t);



                        this.ID = Convert.ToInt32(_xDoc.SelectSingleNode(DocElement + "id").InnerText);

                        this.tagID   = Convert.ToString(_xDocTag.SelectSingleNode(fullPath + "/tagID").InnerText);
                        this.tagPC   = Convert.ToString(_xDocTag.SelectSingleNode(fullPath + "/tagPC").InnerText);
                        this.utcTime = Convert.ToDateTime(_xDocTag.SelectSingleNode(fullPath + "/utcTime").InnerText);
                        string _ant = Convert.ToString(_xDocTag.SelectSingleNode(fullPath + "antennaName").InnerText);
                        Enum.TryParse(_ant, out antennaName _enum);
                        this.antenna = _enum;
                        this.rSSI    = Convert.ToInt32(_xDocTag.SelectSingleNode(fullPath + "/rSSI").InnerText);
                        this.channel = Convert.ToInt32(_xDocTag.SelectSingleNode(fullPath + "/channel").InnerText);
                        this.power   = Convert.ToInt32(_xDocTag.SelectSingleNode(fullPath + "/power").InnerText);
                        _ant         = Convert.ToString(_xDocTag.SelectSingleNode(fullPath + "/polarization").InnerText);
                        Enum.TryParse(_ant, out Polarisation _pol);
                        this.polarization = _pol;

                        Tag _tags = new Tag();
                        _tags.ID = this.tagID;
                        _tags.PC = this.tagPC;

                        this.list.Add(_tags.Copy());
                    }
                    Console.WriteLine(tag.Count + "Tag gefunden.");
                }
            }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DVBSChannel"/> class.
 /// </summary>
 /// <param name="chan">The chan.</param>
 public DVBSChannel(DVBSChannel chan)
     : base(chan)
 {
     _polarisation       = chan.Polarisation;
     _symbolRate         = chan.SymbolRate;
     _switchingFrequency = chan.SwitchingFrequency;
     DisEqc          = chan.DisEqc;
     _bandType       = chan.BandType;
     _modulation     = chan.ModulationType;
     _innerFecRate   = chan.InnerFecRate;
     _pilot          = chan.Pilot;
     _rollOff        = chan.Rolloff;
     _satelliteIndex = chan.SatelliteIndex;
 }
        private TPolarization Translate(Polarisation pol)
        {
            switch (pol)
            {
            case Polarisation.CircularL:
            case Polarisation.LinearH:
                return(TPolarization.TPol_Horizontal);

            case Polarisation.CircularR:
            case Polarisation.LinearV:
                return(TPolarization.TPol_Vertical);

            default:
                return(TPolarization.TPol_None);
            }
        }
        /// <summary>
        /// Sends the DiSEqC command.
        /// </summary>
        /// <param name="command">The DiSEqC command.</param>
        /// <param name="polarisation">The horizontal or vertical polarisation..</param>
        /// <returns>True if succeeded: false otherwise.</returns>
        private bool sendCommand(byte[] command, Polarisation polarisation)
        {
            IntPtr commandBuffer = Marshal.AllocCoTaskMem(1024);

            for (int index = 0; index < command.Length; ++index)
            {
                Marshal.WriteByte(commandBuffer, index, command[index]);
            }

            Logger.Instance.Write("TechnoTrend DiSEqC handler: sending command " + ConvertToHex(command));

            int reply = bdaapiSetDiSEqCMsg(handle, commandBuffer, (byte)command.Length, 1, 0, (short)polarisation);

            if (reply != 0)
            {
                Logger.Instance.Write("TechnoTrend DiSEqC handler: command failed error code 0x" + reply.ToString("X"));
            }
            else
            {
                Logger.Instance.Write("TechnoTrend DiSEqC handler: command succeeded");
            }

            return(reply == 0);
        }
 private static extern APIErrorCodes bdaapiSetDiSEqCMsg(IntPtr device, byte[] data, byte bytes, byte repeat, byte tone, Polarisation polarisation);
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DVBSChannel"/> class.
 /// </summary>
 /// <param name="chan">The chan.</param>
 public DVBSChannel(DVBSChannel chan)
   : base(chan)
 {
   _polarisation = chan.Polarisation;
   _symbolRate = chan.SymbolRate;
   _switchingFrequency = chan.SwitchingFrequency;
   DisEqc = chan.DisEqc;
   _bandType = chan.BandType;
   _modulation = chan.ModulationType;
   _innerFecRate = chan.InnerFecRate;
   _pilot = chan.Pilot;
   _rollOff = chan.Rolloff;
   _satelliteIndex = chan.SatelliteIndex;
 }
 private static extern APIErrorCodes bdaapiSetDiSEqCMsg( IntPtr device, byte[] data, byte bytes, byte repeat, byte tone, Polarisation polarisation );
Beispiel #8
0
 private TPolarization Translate(Polarisation pol)
 {
   switch (pol)
   {
     case Polarisation.CircularL:
     case Polarisation.LinearH:
       return TPolarization.TPol_Horizontal;
     case Polarisation.CircularR:
     case Polarisation.LinearV:
       return TPolarization.TPol_Vertical;
     default:
       return TPolarization.TPol_None;
   }
 }
        /// <summary>
        /// Sends the DiSEqC command.
        /// </summary>
        /// <param name="command">The DiSEqC command.</param>
        /// <param name="polarisation">The horizontal or vertical polarisation..</param>
        /// <returns>True if succeeded: false otherwise.</returns>
        private bool sendCommand(byte[] command, Polarisation polarisation)
        {
            IntPtr commandBuffer = Marshal.AllocCoTaskMem(1024);

            for (int index = 0; index < command.Length; ++index)
                Marshal.WriteByte(commandBuffer, index, command[index]);

            Logger.Instance.Write("TechnoTrend DiSEqC handler: sending command " + ConvertToHex(command));

            int reply = bdaapiSetDiSEqCMsg(handle, commandBuffer, (byte)command.Length, 1, 0, (short)polarisation);
            if (reply != 0)
                Logger.Instance.Write("TechnoTrend DiSEqC handler: command failed error code 0x" + reply.ToString("X"));
            else
                Logger.Instance.Write("TechnoTrend DiSEqC handler: command succeeded");

            return (reply == 0);
        }
Beispiel #10
0
 /**
  * Задать поляризацию для которой рассчитана ДН.
  * @param polarisation поляризация для которой рассчитана ДН.
  */
 public void setPolarisation(Polarisation polarisation)
 {
     this.polarisation = polarisation;
 }