1
0
mirror of https://github.com/mbirth/cm2010.git synced 2024-09-18 22:03:25 +01:00

modified CM2010.dfm

modified   CM2010.pas
+ Show selected capacity above progress bar for each slot
This commit is contained in:
mbirth 2004-12-08 08:59:21 +00:00
parent 4e5a946cb4
commit 2c6fb61c1d
2 changed files with 86 additions and 2 deletions

View File

@ -135,6 +135,66 @@ object Form1: TForm1
Height = 13 Height = 13
Caption = 'secs' Caption = 'secs'
end end
object T_1: TLabel
Left = 344
Top = 166
Width = 49
Height = 10
Alignment = taCenter
AutoSize = False
Caption = '---------'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object T_2: TLabel
Left = 344
Top = 238
Width = 49
Height = 10
Alignment = taCenter
AutoSize = False
Caption = '---------'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object T_3: TLabel
Left = 544
Top = 166
Width = 49
Height = 10
Alignment = taCenter
AutoSize = False
Caption = '---------'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object T_4: TLabel
Left = 544
Top = 238
Width = 49
Height = 10
Alignment = taCenter
AutoSize = False
Caption = '---------'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object GraphDelayBar: TTrackBar object GraphDelayBar: TTrackBar
Left = 648 Left = 648
Top = 256 Top = 256

View File

@ -72,6 +72,10 @@ type
Label18: TLabel; Label18: TLabel;
Label19: TLabel; Label19: TLabel;
Label20: TLabel; Label20: TLabel;
T_1: TLabel;
T_2: TLabel;
T_3: TLabel;
T_4: TLabel;
procedure COMSettingsClick(Sender: TObject); procedure COMSettingsClick(Sender: TObject);
procedure MultiButtClick(Sender: TObject); procedure MultiButtClick(Sender: TObject);
procedure ComPortAfterOpen(Sender: TObject); procedure ComPortAfterOpen(Sender: TObject);
@ -423,11 +427,10 @@ begin
end; end;
procedure DoDisplay(s: byte; m: TMemo); procedure DoDisplay(s: byte; m: TMemo);
var b2,b3,b4: string[2]; var b2,b3: string[2];
begin begin
b2 := ShowHex(Ord(Slot[s][2])); b2 := ShowHex(Ord(Slot[s][2]));
b3 := ShowHex(Ord(Slot[s][3])); b3 := ShowHex(Ord(Slot[s][3]));
b4 := ShowHex(Ord(Slot[s][4]));
if (b2+b3='0000') then begin if (b2+b3='0000') then begin
DoEmptyDisp(s, m); DoEmptyDisp(s, m);
m.Enabled := false; m.Enabled := false;
@ -482,6 +485,23 @@ begin
end; end;
end; end;
function GetManType(s: byte): String;
begin
case Ord(Slot[s][3]) AND $F0 of
$00: Result := 'Automatic';
$10: Result := '100-200';
$20: Result := '200-350';
$30: Result := '350-600';
$40: Result := '600-900';
$50: Result := '900-1200';
$60: Result := '1200-1500';
$70: Result := '1500-2200';
$80: Result := '2200-....';
else
Result := '?????????';
end;
end;
function MakeBuf(s: integer): TBuf; function MakeBuf(s: integer): TBuf;
var i: integer; var i: integer;
begin begin
@ -631,24 +651,28 @@ begin
1: begin 1: begin
Edit1.Text := BuildHex(Slot[1]); Edit1.Text := BuildHex(Slot[1]);
DoDisplay(1, D_1); DoDisplay(1, D_1);
T_1.Caption := GetManType(1);
PB_1.Position := GetProgress(1); PB_1.Position := GetProgress(1);
DoLog(1); DoLog(1);
end; end;
2: begin 2: begin
Edit2.Text := BuildHex(Slot[2]); Edit2.Text := BuildHex(Slot[2]);
DoDisplay(2, D_2); DoDisplay(2, D_2);
T_2.Caption := GetManType(2);
PB_2.Position := GetProgress(2); PB_2.Position := GetProgress(2);
DoLog(2); DoLog(2);
end; end;
3: begin 3: begin
Edit3.Text := BuildHex(Slot[3]); Edit3.Text := BuildHex(Slot[3]);
DoDisplay(3, D_3); DoDisplay(3, D_3);
T_3.Caption := GetManType(3);
PB_3.Position := GetProgress(3); PB_3.Position := GetProgress(3);
DoLog(3); DoLog(3);
end; end;
4: begin 4: begin
Edit4.Text := BuildHex(Slot[4]); Edit4.Text := BuildHex(Slot[4]);
DoDisplay(4, D_4); DoDisplay(4, D_4);
T_4.Caption := GetManType(4);
PB_4.Position := GetProgress(4); PB_4.Position := GetProgress(4);
DoLog(4); DoLog(4);
end; end;