Beispiel #1
0
        public override void Post_NewtonSoft_Json_Deserialization(DeviceObject device)
        {
            base.Post_NewtonSoft_Json_Deserialization(device);

            // In this copy the type become int64
            for (int i = 0; i < 3; i++)
            {
                m_PROP_PRIORITY[i] = new BacnetValue(BacnetApplicationTags.BACNET_APPLICATION_TAG_UNSIGNED_INT, (uint)Convert.ToUInt16(m_PROP_PRIORITY[i].Value));
            }
        }
Beispiel #2
0
 public override void Post_NewtonSoft_Json_Deserialization(DeviceObject device)
 {
     base.Post_NewtonSoft_Json_Deserialization(device);
     if (TrendBuffer != null)
     {
         Shift_DateTime();
     }
     else
     {
         LogPtr = 0;
         m_PROP_RECORD_COUNT = 0;
     }
 }
        public override void Post_NewtonSoft_Json_Deserialization(DeviceObject device)
        {
            base.Post_NewtonSoft_Json_Deserialization(device);

            // basic int becom int64 for instance during serialization/deserialization
            for (int i = 0; i < 16; i++)
            {
                if (m_PROP_PRIORITY_ARRAY[i].Tag != BacnetApplicationTags.BACNET_APPLICATION_TAG_NULL)
                {
                    m_PROP_PRIORITY_ARRAY[i] = new BacnetValue(m_PROP_PRIORITY_ARRAY[i].Tag, Convert.ChangeType(m_PROP_PRIORITY_ARRAY[i].Value, typeof(T)));
                }
            }
        }
 public override void Post_NewtonSoft_Json_Deserialization(DeviceObject device)
 {
     base.Post_NewtonSoft_Json_Deserialization(device);
     // uint a int change to int64, uint64
     foreach (List <DaySchedule> dsl in  m_PROP_WEEKLY_SCHEDULE.days)
     {
         if (dsl != null)
         {
             foreach (DaySchedule ds in dsl)
             {
                 if (ds.Value.GetType() == typeof(Int64))
                 {
                     ds.Value = Convert.ChangeType(ds.Value, typeof(Int32));
                 }
                 if (ds.Value.GetType() == typeof(UInt64))
                 {
                     ds.Value = Convert.ChangeType(ds.Value, typeof(UInt32));
                 }
             }
         }
     }
     try
     {
         if (m_PROP_PRESENT_VALUE.GetType() == typeof(Int64))
         {
             m_PROP_PRESENT_VALUE = Convert.ChangeType(m_PROP_PRESENT_VALUE, typeof(Int32));
         }
         if (m_PROP_PRESENT_VALUE.GetType() == typeof(UInt64))
         {
             m_PROP_PRESENT_VALUE = Convert.ChangeType(m_PROP_PRESENT_VALUE, typeof(UInt32));
         }
     }
     catch { }
     try
     {
         if (m_PROP_SCHEDULE_DEFAULT.GetType() == typeof(Int64))
         {
             m_PROP_SCHEDULE_DEFAULT = Convert.ChangeType(m_PROP_SCHEDULE_DEFAULT, typeof(Int32));
         }
         if (m_PROP_SCHEDULE_DEFAULT.GetType() == typeof(UInt64))
         {
             m_PROP_SCHEDULE_DEFAULT = Convert.ChangeType(m_PROP_SCHEDULE_DEFAULT, typeof(UInt32));
         }
     }
     catch { }
     DoScheduling();
 }
 public override void Post_NewtonSoft_Json_Deserialization(DeviceObject device)
 {
     base.Post_NewtonSoft_Json_Deserialization(device);
     DayChanged(tmrId);
 }
 // Object was not created with a new in the code but by a Deserialization
 // using the default constructor
 // some additionnal up to run code must be executed
 // Only a call to the method (without parameter) on the device object should be made
 public virtual void Post_NewtonSoft_Json_Deserialization(DeviceObject device)
 {
     Mydevice = device;
 }