Ejemplo n.º 1
0
        internal S1Sources AddSource(S1Sources source)
        {
            if (GetSoureceByName(source.idscene) == null)
            {
                context.S1Sources.InsertOnSubmit(source);
                try
                {
                    context.S1Sources.InsertOnSubmit(source);
                    Submit();

                    return(GetSoureceByName(source.idscene));
                }
                catch (MilSpaceDataException ex)
                {
                    log.WarnEx(ex.Message);

                    if (ex.InnerException != null)
                    {
                        log.WarnEx(ex.InnerException.Message);
                    }
                }
                catch (Exception ex)
                {
                    log.WarnEx($"Unexpected exception:{ex.Message}");
                }
            }

            return(null);
        }
Ejemplo n.º 2
0
 internal static SentinelSource Get(this S1Sources source)
 {
     return(new SentinelSource
     {
         IdRow = source.idrow,
         BurstNumber = source.nburst.HasValue ? source.nburst.Value : -1,
         DateTime = source.dttime.HasValue ? source.dttime.Value : DateTime.MinValue,
         Dto = source.dto.HasValue ? source.dto.Value : DateTime.MinValue,
         Extend = source.extend,
         Operator = source.soper,
         OrbitNumber = source.norbit.HasValue ? source.norbit.Value : -1,
         SceneId = source.idscene,
     });
 }