Exemplo n.º 1
0
        public void Write(int channelID, SeriesID seriesID, DateTime timestamp, double value)
        {
            HistorianKey   historianKey   = new HistorianKey();
            HistorianValue historianValue = new HistorianValue();

            historianKey.PointID         = ToPointID(channelID, (int)seriesID);
            historianKey.TimestampAsDate = timestamp;
            historianValue.AsSingle      = (float)value;

            m_queue.Value.Enqueue(historianKey, historianValue);
        }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            int ret = (Title != null) ? Title.GetHashCode() : 0;

            ret  = (ret * 397) ^ ((EpisodeNumber != null) ? EpisodeNumber.GetHashCode() : 0);
            ret  = (ret * 397) ^ ((EpisodeTitle != null) ? EpisodeTitle.GetHashCode() : 0);
            ret  = (ret * 397) ^ ((Synopsis != null) ? Synopsis.GetHashCode() : 0);
            ret  = (ret * 397) ^ ((Team1 != null) ? Team1.GetHashCode() : 0);
            ret  = (ret * 397) ^ ((Team2 != null) ? Team2.GetHashCode() : 0);
            ret  = (ret * 397) ^ SeriesID.GetHashCode();
            ret &= 0x7fffffff;

            return(ret);
        }
Exemplo n.º 3
0
        public void UpdateTokenID(TokenSeriesMode mode)
        {
            byte[] bytes;

            switch (mode)
            {
            case TokenSeriesMode.Unique: bytes = ROM; break;

            case TokenSeriesMode.Duplicated: bytes = ROM.Concat(SeriesID.ToUnsignedByteArray()).Concat(MintID.ToUnsignedByteArray()).ToArray(); break;

            default:
                throw new ChainException($"Generation of tokenID for Series with {mode} is not implemented");
            }

            this.TokenID = Hash.FromBytes(bytes);
        }
        public string SetSearchResultMessage()
        {
            string mssg          = "";
            var    keywordSearch = "";

            if (txtTSKeyword.Text.Length > 0)
            {
                keywordSearch = ". Searched on keyword: " + txtTSKeyword.Text;
            }
            if (chkAllGrades.Checked)
            {
                mssg = string.Format("Search Task in Series:{0}" + keywordSearch, SeriesID.ToString());
            }
            else
            {
                mssg = string.Format("Search Task in Series:{0} - Grade:{1}" + keywordSearch, SeriesID.ToString(), CurrentGrade.ToString());
            }
            return(mssg);
        }
Exemplo n.º 5
0
        void removeSeasonFromSeries()
        {
            string seasonFormat = SeriesID.ToString() + 'S';

            removeFromFanart(seasonFormat);
        }
Exemplo n.º 6
0
        private long ToPointID(int channelID, SeriesID seriesID)
        {
            ulong pointID = Historian.ToPointID(channelID, (int)seriesID);

            return(unchecked ((long)pointID));
        }
 /// <summary>
 /// Serves as a hash function for a particular type. GetHashCode() is suitable
 /// for use in hashing algorithms and data structures like a hash table.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     return(SeriesID.GetHashCode() ^ FactorLevelID.GetHashCode());
 }
 ///<summary>
 /// Returns a String that represents the current object.
 ///</summary>
 public override string ToString()
 {
     return("SeriesID:" + SeriesID.ToString() + "GSSGFactorLevelID:" + FactorLevelID.ToString());
 }
Exemplo n.º 9
0
 /// <summary>
 /// Serves as a hash function for a particular type. GetHashCode() is suitable
 /// for use in hashing algorithms and data structures like a hash table.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     return(SeriesID.GetHashCode() ^ Grade.GetHashCode() ^ KSAID.GetHashCode() ^ TaskStatementID.GetHashCode());
 }
Exemplo n.º 10
0
 ///<summary>
 /// Returns a String that represents the current object.
 ///</summary>
 public override string ToString()
 {
     return("SeriesID:" + SeriesID.ToString() + "Grade:" + Grade.ToString() + "KSAID:" + KSAID.ToString() + "TaskStatementID:" + TaskStatementID.ToString());
 }
Exemplo n.º 11
0
 /// <summary>
 /// Serves as a hash function for a particular type. GetHashCode() is suitable
 /// for use in hashing algorithms and data structures like a hash table.
 /// </summary>
 /// <returns>A hash code for the current object.</returns>
 public override int GetHashCode()
 {
     return(SeriesID.GetHashCode());
 }
Exemplo n.º 12
0
 ///<summary>
 /// Returns a String that represents the current object.
 ///</summary>
 public override string ToString()
 {
     return("SeriesID:" + SeriesID.ToString());
 }