protected virtual bool OnLoadProfileConfigurationCompleted(byte[] data) { bool result = true; try { ActualLoadProfileTable actualLoadProfileTableParser = new ActualLoadProfileTable(); actualLoadProfileTableParser.Parse(data); ansiProtocolSession.Services.Add(new ReadService(ReadingType.PartialReadWithOffset, new object[] { new Table(TableName.LoadProfileDataSet1Table), actualLoadProfileTableParser.LpMemoryLen, 0 })); } catch (Exception ex) { result = false; logger.Error(ex, nameof(OnLoadProfileConfigurationCompleted)); } return(result); }
public static ITableParser Creator(TableIdentification tableName) { ITableParser tableParser = null; switch (tableName) { case TableIdentification.GeneralManufacturerIdentification: tableParser = new GeneralManufacturerIdentificationTable(); break; case TableIdentification.ModeAndStatusStandardTable: break; case TableIdentification.StatusManufacturerTable: break; case TableIdentification.Multipliers: break; case TableIdentification.PrimaryMeteringInformation: tableParser = new PrimaryMeteringInformation(); break; case TableIdentification.ElsterSourceDefinitionTable: tableParser = new ElsterSourceDefinitionTable(); break; case TableIdentification.ActualRegisterTable: tableParser = new ActualRegisterTable(); break; case TableIdentification.DataSelectionTable: tableParser = new DataSelectionTable(); break; case TableIdentification.CurrentRegisterDataTable: tableParser = new CurrentRegisterDataTable(); break; case TableIdentification.PreviousSeasonDataTable: tableParser = new PreviousSeasonDataTable(); break; case TableIdentification.PreviousDemandResetDataTable: tableParser = new PreviousDemandResetDataTable(); break; case TableIdentification.PresentRegisterDataTable: tableParser = new PresentRegisterDataTable(); break; case TableIdentification.ActualLoadProfileTable: tableParser = new ActualLoadProfileTable(); break; case TableIdentification.LoadProfileDataSet1Table: tableParser = new LoadProfileDataSet1Table(); break; case TableIdentification.EventLogDataTable: tableParser = new EventLogDataTable(); break; default: break; } return(tableParser); }