/// <summary>
        /// Read standard OBIS code information from the file.
        /// </summary>
        /// <param name="codes">Collection of standard OBIS codes.</param>
        private static void ReadStandardObisInfo(Standard standard, GXStandardObisCodeCollection codes)
        {
#if !WINDOWS_UWP
            if (standard != Standard.DLMS)
            {
                foreach (GXObisCode it in GetObjects(standard))
                {
                    GXStandardObisCode tmp = new GXStandardObisCode()
                    {
                        Interfaces  = ((int)it.ObjectType).ToString(),
                        OBIS        = it.LogicalName.Split(new char[] { '.' }),
                        Description = it.Description,
                        UIDataType  = it.UIDataType
                    };
                    codes.Add(tmp);
                }
            }
#if __MOBILE__
            string[] rows = Resources.OBISCodes.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
#else
            string[] rows = Gurux.DLMS.Properties.Resources.OBISCodes.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
#endif //__MOBILE__

            foreach (string it in rows)
            {
                string[]           items = it.Split(new char[] { ';' });
                string[]           obis  = items[0].Split(new char[] { '.' });
                GXStandardObisCode code  = new GXStandardObisCode(obis, items[3] + "; " + items[4] + "; " +
                                                                  items[5] + "; " + items[6] + "; " + items[7], items[1], items[2]);
                codes.Add(code);
            }
#else
            //TODO:
#endif
        }
예제 #2
0
 /// <summary>
 /// Read standard OBIS code information from the file.
 /// </summary>
 /// <param name="codes">Collection of standard OBIS codes.</param>
 private static void ReadStandardObisInfo(GXStandardObisCodeCollection codes)
 {
     string[] rows = Gurux.DLMS.Properties.Resources.OBISCodes.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries);
     foreach (string it in rows)
     {
         string[]           items = it.Split(new char[] { ';' });
         string[]           obis  = items[0].Split(new char[] { '.' });
         GXStandardObisCode code  = new GXStandardObisCode(obis, items[3] + "; " + items[4] + "; " +
                                                           items[5] + "; " + items[6] + "; " + items[7], items[1], items[2]);
         codes.Add(code);
     }
 }