Skip to content

Commit 148c09a

Browse files
committed
WIP - improvements and bugfixes.
1 parent 783b73b commit 148c09a

11 files changed

+210
-146
lines changed

Bin/Win32/settings.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"DebugMode": false,
3-
"EmitLogMessages": true,
3+
"EmitLogMessages": false,
44
"FormSettings": {
5-
"Left": 305,
6-
"Top": 52,
7-
"Width": 2232,
8-
"Height": 1266,
5+
"Left": 416,
6+
"Top": 47,
7+
"Width": 1969,
8+
"Height": 1074,
99
"FormStyle": 0,
1010
"WindowState": 0
1111
},
@@ -17,8 +17,8 @@
1717
"MessageDetailsVisible": true,
1818
"SmartTimeStamps": true,
1919
"HorizontalPanelPositions": [
20-
0.270848182466144,
21-
0.692702980472765,
20+
0.264720942140297,
21+
0.666666666666667,
2222
1
2323
],
2424
"LeftVerticalPanelPositions": [
@@ -30,14 +30,14 @@
3030
"Enabled": false
3131
},
3232
"WinipcSettings": {
33-
"Enabled": false,
33+
"Enabled": true,
3434
"PollingInterval": 100
3535
},
3636
"ZmqSettings": {
3737
"Enabled": false,
3838
"PollingInterval": 100,
3939
"PollingTimeout": 10,
40-
"Endpoints": "New=tcp://localhost:42134\r\nNew_1=tcp://SBVCTITPOA8:5555\r\n"
40+
"Endpoints": ""
4141
},
4242
"FileSystemSettings": {
4343
"Enabled": false,
@@ -197,12 +197,12 @@
197197
"LogLevelSettings": {
198198
"LogLevels": [
199199
{
200-
"Alias": "Base",
200+
"Alias": "",
201201
"Color": 15793151,
202202
"Level": 0
203203
},
204204
{
205-
"Alias": "Green",
205+
"Alias": "",
206206
"Color": 32768,
207207
"Level": 1
208208
},
@@ -212,12 +212,12 @@
212212
"Level": 2
213213
},
214214
{
215-
"Alias": "Three",
215+
"Alias": "",
216216
"Color": 8454143,
217217
"Level": 3
218218
},
219219
{
220-
"Alias": "Four",
220+
"Alias": "",
221221
"Color": 8453888,
222222
"Level": 4
223223
},
@@ -252,7 +252,7 @@
252252
"Level": 10
253253
},
254254
{
255-
"Alias": "SQL",
255+
"Alias": "",
256256
"Color": 8421376,
257257
"Level": 11
258258
},

LogViewer.Dashboard.View.dfm

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,12 @@ object frmDashboard: TfrmDashboard
5858
TabOrder = 0
5959
object tsWinIpc: TKTabSheet
6060
Caption = 'WinIPC'
61-
ExplicitWidth = 0
62-
ExplicitHeight = 0
6361
object lblWinIPC: TLabel
6462
AlignWithMargins = True
6563
Left = 3
6664
Top = 28
67-
Width = 307
68-
Height = 221
65+
Width = 308
66+
Height = 588
6967
Align = alClient
7068
Caption =
7169
'Messages are exchanged between the source application and LogVie' +
@@ -84,6 +82,8 @@ object frmDashboard: TfrmDashboard
8482
ParentFont = False
8583
Transparent = True
8684
WordWrap = True
85+
ExplicitWidth = 307
86+
ExplicitHeight = 221
8787
end
8888
object pnlWinIPCTitle: TPanel
8989
Left = 0
@@ -106,14 +106,12 @@ object frmDashboard: TfrmDashboard
106106
end
107107
object tsWinOds: TKTabSheet
108108
Caption = 'WinODS'
109-
ExplicitWidth = 0
110-
ExplicitHeight = 0
111109
object lblWinods: TLabel
112110
AlignWithMargins = True
113111
Left = 3
114112
Top = 28
115113
Width = 308
116-
Height = 374
114+
Height = 588
117115
Align = alClient
118116
Caption =
119117
'This receiver captures messages from any local applicatiion that' +
@@ -138,6 +136,7 @@ object frmDashboard: TfrmDashboard
138136
ParentFont = False
139137
Transparent = True
140138
WordWrap = True
139+
ExplicitHeight = 374
141140
end
142141
object pnlWinodsTitle: TPanel
143142
Left = 0
@@ -256,8 +255,6 @@ object frmDashboard: TfrmDashboard
256255
end
257256
object tsFileSystem: TKTabSheet
258257
Caption = 'FileSystem'
259-
ExplicitWidth = 0
260-
ExplicitHeight = 0
261258
object pnlFileSystemTitle: TPanel
262259
Left = 0
263260
Top = 0
@@ -288,8 +285,6 @@ object frmDashboard: TfrmDashboard
288285
end
289286
object tsComPort: TKTabSheet
290287
Caption = 'COM port'
291-
ExplicitWidth = 0
292-
ExplicitHeight = 0
293288
object pnlComPorts: TPanel
294289
Left = 0
295290
Top = 25

LogViewer.Dashboard.View.pas

Lines changed: 50 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ TfrmDashboard = class(TForm)
157157
var Ghosted : Boolean;
158158
var ImageIndex : TImageIndex
159159
);
160+
procedure FTreeViewPaintText(
161+
Sender : TBaseVirtualTree;
162+
const TargetCanvas : TCanvas;
163+
Node : PVirtualNode;
164+
Column : TColumnIndex;
165+
TextType : TVSTTextType
166+
);
160167
procedure FZmqEndpointsAdd(
161168
ASender : TObject;
162169
var AName : string;
@@ -316,7 +323,7 @@ destructor TfrmDashboard.Destroy;
316323
// FComPortReceiver.OnChange.RemoveAll(Self);
317324

318325
SaveSettings;
319-
FZmqReceiver := nil;
326+
FZmqReceiver := nil;
320327
FWinipcReceiver := nil;
321328
FWinodsReceiver := nil;
322329
// FComPortReceiver := nil;
@@ -411,14 +418,15 @@ procedure TfrmDashboard.FTreeViewBeforeCellPaint(Sender: TBaseVirtualTree;
411418
DN : TDashboardNode;
412419
begin
413420
DN := Sender.GetNodeData<TDashboardNode>(Node);
414-
if Sender.GetNodeLevel(Node) = 0 then
421+
if DN.Level = 0 then
415422
begin
416423
if DN.Data.Receiver.Enabled then
417424
Node.CheckState := csCheckedNormal
418425
else
419426
Node.CheckState := csUncheckedNormal;
427+
TargetCanvas.Font.Style := [fsBold];
420428
end
421-
else if Sender.GetNodeLevel(Node) = 1 then
429+
else if DN.Level = 1 then
422430
begin
423431
if DN.Data.Subscriber.Enabled then
424432
Node.CheckState := csCheckedNormal
@@ -436,7 +444,7 @@ procedure TfrmDashboard.FTreeViewChecked(Sender: TBaseVirtualTree;
436444
DN := Sender.GetNodeData<TDashboardNode>(Node);
437445
if Assigned(DN) then
438446
begin
439-
if Sender.GetNodeLevel(Node) = 0 then
447+
if DN.Level = 0 then
440448
begin
441449
B := Node.CheckState = csCheckedNormal;
442450
DN.Data.Receiver.Enabled := B;
@@ -556,7 +564,7 @@ procedure TfrmDashboard.FTreeViewGetImageIndex(Sender: TBaseVirtualTree;
556564
begin
557565
DN := Sender.GetNodeData<TDashboardNode>(Node);
558566
LReceiver := DN.Data.Receiver;
559-
if (Sender.GetNodeLevel(Node) = 0) and (Kind in [ikNormal, ikSelected]) then
567+
if (DN.Level = 0) and (Kind in [ikNormal, ikSelected]) then
560568
begin
561569
if LReceiver = FZmqReceiver then
562570
begin
@@ -578,7 +586,7 @@ procedure TfrmDashboard.FTreeViewGetPopupMenu(Sender: TBaseVirtualTree;
578586
DN : TDashboardNode;
579587
begin
580588
DN := Sender.GetNodeData<TDashboardNode>(Node);
581-
if Assigned(DN) and (Sender.GetNodeLevel(Node) = 1) then
589+
if Assigned(DN) and (DN.Level = 1) then
582590
begin
583591
PopupMenu := FManager.Menus.SubscriberPopupMenu;
584592
end;
@@ -599,7 +607,6 @@ procedure TfrmDashboard.FTreeViewGetText(Sender: TBaseVirtualTree;
599607
Result := DateTimeToStr(ADateTime);
600608
end;
601609

602-
603610
begin
604611
CellText := '';
605612
if not Assigned(Node) then
@@ -608,7 +615,7 @@ procedure TfrmDashboard.FTreeViewGetText(Sender: TBaseVirtualTree;
608615
DN := Sender.GetNodeData<TDashboardNode>(Node);
609616
if Assigned(DN) then
610617
begin
611-
if Sender.GetNodeLevel(Node) = 0 then
618+
if DN.Level = 0 then
612619
begin
613620
if Column = COLUMN_SOURCENAME then
614621
CellText := DN.Data.Caption
@@ -638,6 +645,40 @@ procedure TfrmDashboard.FTreeViewGetText(Sender: TBaseVirtualTree;
638645
end;
639646
end;
640647
end;
648+
649+
procedure TfrmDashboard.FTreeViewPaintText(Sender: TBaseVirtualTree;
650+
const TargetCanvas: TCanvas; Node: PVirtualNode; Column: TColumnIndex;
651+
TextType: TVSTTextType);
652+
var
653+
DN : TDashboardNode;
654+
begin
655+
DN := Sender.GetNodeData<TDashboardNode>(Node);
656+
if Assigned(DN) then
657+
begin
658+
if DN.Level = 0 then
659+
TargetCanvas.Font.Style := [fsBold]
660+
else if DN.Level = 1 then
661+
begin
662+
if Column < 2 then
663+
begin
664+
TargetCanvas.Font.Style := [fsBold];
665+
end
666+
else
667+
begin
668+
TargetCanvas.Font.Style := [];
669+
end;
670+
if DN.Data.Subscriber.IsSourceActive then
671+
begin
672+
if DN.Data.Subscriber.Enabled then
673+
TargetCanvas.Font.Color := clGreen
674+
else
675+
TargetCanvas.Font.Color := clRed;
676+
end
677+
else
678+
TargetCanvas.Font.Color := clGray;
679+
end;
680+
end;
681+
end;
641682
{$ENDREGION}
642683

643684
{$REGION 'Subscriber lists'}
@@ -995,6 +1036,7 @@ procedure TfrmDashboard.InitializeTreeView;
9951036
FTreeView.OnDblClick := FTreeViewDblClick;
9961037
FTreeView.OnGetImageIndex := FTreeViewGetImageIndex;
9971038
FTreeView.OnGetPopupMenu := FTreeViewGetPopupMenu;
1039+
FTreeView.OnPaintText := FTreeViewPaintText;
9981040
with FTreeView do
9991041
begin
10001042
with Header.Columns.Add do

LogViewer.Interfaces.pas

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,9 @@ interface
7373
function GetTimeStampFirst: TDateTime;
7474
function GetTimeStampLast: TDateTime;
7575
function GetBytesReceived: Int64;
76+
function GetIsSourceActive: Boolean;
7677
{$ENDREGION}
78+
7779
procedure Poll;
7880
procedure Reset;
7981
procedure Close;
@@ -97,6 +99,9 @@ interface
9799
property SourceId: UInt32
98100
read GetSourceId;
99101

102+
property IsSourceActive: Boolean
103+
read GetIsSourceActive;
104+
100105
property SourceName: string
101106
read GetSourceName;
102107

LogViewer.MainForm.pas

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,25 @@ interface
4040

4141
type
4242
TfrmMain = class(TForm)
43-
pnlMain: TPanel;
44-
pnlMainClient: TPanel;
45-
ctMain: TChromeTabs;
46-
pnlStatusBar: TPanel;
47-
shpLine: TShape;
48-
pnlSourceName: TPanel;
49-
pnlDelta: TPanel;
50-
pbrCPU: TKPercentProgressBar;
51-
pnlMessageCount: TPanel;
52-
pnlMemory: TPanel;
53-
aclMain: TActionList;
54-
actCenterToScreen: TAction;
55-
actShowVersion: TAction;
56-
imlMain: TImageList;
57-
tbrMain: TTaskbar;
58-
tmrPoll: TTimer;
59-
imlTabStates: TImageList;
60-
pnlTitleBar: TTitleBarPanel;
61-
pnlTop: TPanel;
43+
aclMain : TActionList;
44+
actCenterToScreen : TAction;
45+
actShowVersion : TAction;
46+
ctMain : TChromeTabs;
47+
imlMain : TImageList;
48+
imlTabStates : TImageList;
49+
pbrCPU : TKPercentProgressBar;
50+
pnlDelta : TPanel;
51+
pnlMain : TPanel;
52+
pnlMainClient : TPanel;
53+
pnlMemory : TPanel;
54+
pnlMessageCount : TPanel;
55+
pnlSourceName : TPanel;
56+
pnlStatusBar : TPanel;
57+
pnlTitleBar : TTitleBarPanel;
58+
pnlTop : TPanel;
59+
shpLine : TShape;
60+
tbrMain : TTaskbar;
61+
tmrPoll : TTimer;
6262
{$ENDREGION}
6363

6464
{$REGION 'action handlers'}
@@ -592,30 +592,18 @@ procedure TfrmMain.UpdateTabStates;
592592
begin
593593
LV := ILogViewer(ctMain.Tabs[I].Data);
594594
S := LV.Subscriber;
595-
if Supports(S, IWinipc) or Supports(S, IWinods) then
596-
begin
597-
if CheckProcessExists(S.SourceId) then
598-
begin
599-
if S.Enabled then
600-
ctMain.Tabs[I].ImageIndex := 0 // Green
601-
else
602-
begin
603-
ctMain.Tabs[I].ImageIndex := 2 // Red
604-
end;
605-
end
606-
else
607-
begin
608-
ctMain.Tabs[I].ImageIndex := 1; // Off
609-
end;
610-
end
611-
else
595+
if S.IsSourceActive then
612596
begin
613597
if S.Enabled then
614598
ctMain.Tabs[I].ImageIndex := 0 // Green
615599
else
616600
begin
617601
ctMain.Tabs[I].ImageIndex := 2 // Red
618602
end;
603+
end
604+
else
605+
begin
606+
ctMain.Tabs[I].ImageIndex := 1; // Off
619607
end;
620608
end;
621609
end;

0 commit comments

Comments
 (0)