Skip to content

Commit

Permalink
Fix issue with EnergyMeter reports, noticed especially in the time/ho…
Browse files Browse the repository at this point in the history
…ur column
  • Loading branch information
PMeira committed Mar 9, 2021
1 parent 6e706b4 commit 0ef72db
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Meters/MemoryMap_lib.pas
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ implementation
type
TByteArr = array of uint8;

var
wordBuf: Word;
// $01A0 is Header for identifying String type data
// $02A0 is Header for identifying Double type data
//******************************************************************************
Expand All @@ -56,6 +54,7 @@ implementation
function Create_Meter_Space(Init_Str: String): TBytesStream; OVERLOAD;
var
Mem_Space: TBytesStream;
wordBuf: Word;
begin
Mem_Space := TBytesStream.Create();
{$IFNDEF FPC}
Expand All @@ -72,6 +71,8 @@ function Create_Meter_Space(Init_Str: String): TBytesStream; OVERLOAD;
// Writes a string into the specified BytesStream
//******************************************************************************
procedure WriteintoMemStr(Mem_Space: TBytesStream; Content: String); OVERLOAD;
var
wordBuf: Word;
begin
{$IFNDEF FPC}
Mem_Space.WriteData($01A0); // Header for identifying String type data
Expand All @@ -86,6 +87,8 @@ procedure WriteintoMemStr(Mem_Space: TBytesStream; Content: String); OVERLOAD;
// Writes a DBL into the specified BytesStream
//******************************************************************************
procedure WriteintoMem(Mem_Space: TBytesStream; Content: Double); OVERLOAD;
var
wordBuf: Word;
begin
{$IFNDEF FPC}
Mem_Space.WriteData($02A0); // Header for identifying a double type data
Expand Down Expand Up @@ -196,7 +199,7 @@ procedure CloseMHandler(Mem_Space: TBytesStream; const Dest_Path: String; Append
end
else // Not recognized
begin
idx := idx;
// idx := idx;
end;
end;
end;
Expand Down Expand Up @@ -371,6 +374,8 @@ procedure Write_String(Mem_Space: TBytesStream; const Content: String);
{$ELSE}
for idx := 1 to length(Content) do
Mem_Space.Write(Content[idx], Length(Content[idx])); // TODO - verify AnsiString vs. unicode

Mem_Space.WriteByte(0);
{$ENDIF}
end;

Expand Down

0 comments on commit 0ef72db

Please sign in to comment.