Exemplo n.º 1
0
 string PropertyOPCToString(ePropertyTypes propcdeT, object prop)
 {
     if (propcdeT == ePropertyTypes.TBinary)
     {
         if (prop == null)
         {
             return("(null)");
         }
         StringBuilder buffer = new StringBuilder();
         byte[]        bytes  = (byte[])prop;
         for (int ii = 0; ii < bytes.Length; ii++)
         {
             buffer.AppendFormat(null, "{0:X2}", bytes[ii]);
         }
         return(buffer.ToString());
     }
     else
     {
         if (prop == null)
         {
             return(null);
         }
     }
     return(TheCommonUtils.CStr(prop));
 }
Exemplo n.º 2
0
        public cdeP DeclareSensorProperty(string propertyName, ePropertyTypes propertyType, cdeP.TheSensorMeta sensorMeta)
        {
            cdeP tProp = GetProperty(propertyName, true);

            if (tProp.cdeO != cdeMID)
            {
                tProp.cdeO = cdeMID;
            }
            tProp.cdeE |= 0x04; // cdeCTIM should be updated with changetime
            tProp.SetSensorMeta(sensorMeta);
            return(tProp);
        }