Пример #1
0
        override public void resolveText(DataProcessor dproc, ValueScaler valueScaler)
        {
            base.resolveText(dproc, valueScaler);
            if (resolvedText != null)
            {
                if (strftime)
                {
                    long     timeStamp = dproc.getTimestamps(SrcName)[0];
                    DateTime dt        = Util.ConvertToDateTime(timeStamp);
                    resolvedText = string.Format("{0:yyyy}", dt);//dt.ToString();
                }
                else
                {
                    // Don't support old version GPRINT:vname:CF:format (deprecated)
                    double value = dproc.getValues(SrcName)[0];

                    Regex regex   = new Regex(UNIT_MARKER);
                    Match matcher = regex.Match(resolvedText);
                    //   // ToDo: chek this up!
                    //   if (matcher.Groups.Count > 0)
                    //   {
                    //      // unit specified
                    //      Scaled scaled = valueScaler.scale(value, matcher.Groups[2].Value.CompareTo("s") == 0);
                    //      resolvedText = resolvedText.Substring(0, matcher.Index) +
                    //            matcher.Groups[1] + scaled.unit + resolvedText.Substring(matcher.Index + matcher.Length);
                    //      value = scaled.value;
                    //   }
                    resolvedText = Util.sprintf(resolvedText, new object[] { value });
                }

                trimIfGlue();
            }
        }
Пример #2
0
      override public void resolveText(DataProcessor dproc, ValueScaler valueScaler)
      {
         base.resolveText(dproc, valueScaler);
         if (resolvedText != null)
         {
            if (strftime)
            {
               long timeStamp = dproc.getTimestamps(SrcName)[0];
               DateTime dt = Util.ConvertToDateTime(timeStamp);
               resolvedText = string.Format("{0:yyyy}",dt);//dt.ToString();
            }
            else
            {
               // Don't support old version GPRINT:vname:CF:format (deprecated)
               double value = dproc.getValues(SrcName)[0];

               Regex regex = new Regex(UNIT_MARKER);
               Match matcher = regex.Match(resolvedText);
               //   // ToDo: chek this up!
               //   if (matcher.Groups.Count > 0)
               //   {
               //      // unit specified
               //      Scaled scaled = valueScaler.scale(value, matcher.Groups[2].Value.CompareTo("s") == 0);
               //      resolvedText = resolvedText.Substring(0, matcher.Index) +
               //            matcher.Groups[1] + scaled.unit + resolvedText.Substring(matcher.Index + matcher.Length);
               //      value = scaled.value;
               //   }
               resolvedText = Util.sprintf(resolvedText, new object[] { value });
            }

            trimIfGlue();
         }
      }
Пример #3
0
        private void resolveTextElements()
        {
            ValueScaler valueScaler = new ValueScaler(gdef.scaleBase);

            foreach (CommentText comment in gdef.comments)
            {
                comment.resolveText(dproc, valueScaler);
            }
        }
Пример #4
0
 public virtual void resolveText(DataProcessor dproc, ValueScaler valueScaler)
 {
     resolvedText = text;
     marker       = "";
     if (resolvedText != null)
     {
         foreach (String aMARKERS in MARKERS)
         {
             if (resolvedText.EndsWith(aMARKERS))
             {
                 marker       = aMARKERS;
                 resolvedText = resolvedText.Substring(0, resolvedText.Length - marker.Length);
                 trimIfGlue();
                 break;
             }
         }
     }
     enabled = resolvedText != null;
 }
Пример #5
0
 public virtual void resolveText(DataProcessor dproc, ValueScaler valueScaler)
  {
      resolvedText = text;
      marker = "";
      if (resolvedText != null)
      {
          foreach (String aMARKERS in MARKERS)
          {
              if (resolvedText.EndsWith(aMARKERS))
              {
                  marker = aMARKERS;
                  resolvedText = resolvedText.Substring(0, resolvedText.Length - marker.Length);
                  trimIfGlue();
                  break;
              }
          }
      }
      enabled = resolvedText != null;
  }
Пример #6
0
 private void resolveTextElements()
 {
    ValueScaler valueScaler = new ValueScaler(gdef.scaleBase);
    foreach (CommentText comment in gdef.comments)
    {
       comment.resolveText(dproc, valueScaler);
    }
 }