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
modified   CM2010Project.ini
* upgraded to TComPort v2.64 from http://sourceforge.net/projects/comport (needs testing!)
This commit is contained in:
mbirth 2004-12-08 08:55:13 +00:00
parent 7f5c144e5b
commit f601b97d53
3 changed files with 55 additions and 332 deletions

View File

@ -1,7 +1,7 @@
object Form1: TForm1 object Form1: TForm1
Left = 195 Left = 197
Top = 109 Top = 176
Width = 716 Width = 721
Height = 477 Height = 477
Caption = Caption =
'Charge Manager 2010 --- (c)2003 by Markus Birth <mbirth@webwrite' + 'Charge Manager 2010 --- (c)2003 by Markus Birth <mbirth@webwrite' +
@ -135,66 +135,6 @@ 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
@ -245,163 +185,46 @@ object Form1: TForm1
Height = 73 Height = 73
Caption = 'COM Status' Caption = 'COM Status'
TabOrder = 2 TabOrder = 2
object Label1: TLabel object L_CTS: TLabel
Left = 30 Left = 8
Top = 16 Top = 20
Width = 71 Width = 44
Height = 13 Height = 13
Caption = 'Last character:' Caption = 'CTS high'
Enabled = False
end
object L_DSR: TLabel
Left = 8
Top = 36
Width = 46
Height = 13
Caption = 'DSR high'
Enabled = False
end
object L_RLSD: TLabel
Left = 8
Top = 52
Width = 52
Height = 13
Caption = 'RLSD high'
Enabled = False
end
object Label1: TLabel
Left = 72
Top = 24
Width = 101
Height = 13
Caption = 'Last event character:'
end end
object L_Time: TLabel object L_Time: TLabel
Left = 110 Left = 80
Top = 16 Top = 40
Width = 73 Width = 73
Height = 13 Height = 13
Alignment = taCenter
AutoSize = False AutoSize = False
Caption = 'hh:mm:ss' Caption = 'hh:mm:ss'
end end
object ComLed1: TComLed
Left = 0
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsConn
Kind = lkYellowLight
end
object ComLed2: TComLed
Left = 24
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsCTS
Kind = lkBlueLight
end
object ComLed3: TComLed
Left = 48
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsDSR
Kind = lkRedLight
end
object ComLed4: TComLed
Left = 88
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsRing
Kind = lkPurpleLight
end
object ComLed5: TComLed
Left = 112
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsRLSD
Kind = lkRedLight
end
object ComLed6: TComLed
Left = 144
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsRx
Kind = lkGreenLight
end
object ComLed7: TComLed
Left = 160
Top = 32
Width = 25
Height = 25
ComPort = ComPort
LedSignal = lsTx
Kind = lkRedLight
end
object Label14: TLabel
Left = 150
Top = 54
Width = 13
Height = 13
Caption = 'Rx'
end
object Label15: TLabel
Left = 167
Top = 54
Width = 12
Height = 13
Caption = 'Tx'
end
object Label16: TLabel
Left = 114
Top = 56
Width = 21
Height = 10
Caption = 'RLSD'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object Label17: TLabel
Left = 92
Top = 56
Width = 17
Height = 10
Caption = 'Ring'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object Label18: TLabel
Left = 52
Top = 56
Width = 17
Height = 10
Caption = 'DSR'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object Label19: TLabel
Left = 28
Top = 56
Width = 16
Height = 10
Caption = 'CTS'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
object Label20: TLabel
Left = 3
Top = 56
Width = 19
Height = 10
Caption = 'Conn'
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -8
Font.Name = 'Small Fonts'
Font.Style = []
ParentFont = False
end
end end
object Edit1: TEdit object Edit1: TEdit
Left = 64 Left = 64
@ -510,7 +333,7 @@ object Form1: TForm1
object StatusBar: TStatusBar object StatusBar: TStatusBar
Left = 0 Left = 0
Top = 431 Top = 431
Width = 708 Width = 713
Height = 19 Height = 19
Panels = <> Panels = <>
SimplePanel = True SimplePanel = True
@ -651,38 +474,6 @@ object Form1: TForm1
OnChange = GraphDelayCtrlChange OnChange = GraphDelayCtrlChange
OnKeyDown = GraphDelayCtrlKeyDown OnKeyDown = GraphDelayCtrlKeyDown
end end
object PB_1: TProgressBar
Left = 344
Top = 176
Width = 49
Height = 8
Smooth = True
TabOrder = 24
end
object PB_2: TProgressBar
Left = 344
Top = 248
Width = 49
Height = 8
Smooth = True
TabOrder = 25
end
object PB_3: TProgressBar
Left = 544
Top = 176
Width = 49
Height = 8
Smooth = True
TabOrder = 26
end
object PB_4: TProgressBar
Left = 544
Top = 248
Width = 49
Height = 8
Smooth = True
TabOrder = 27
end
object ColorDialog: TColorDialog object ColorDialog: TColorDialog
Left = 664 Left = 664
Top = 112 Top = 112
@ -707,10 +498,6 @@ object Form1: TForm1
FlowControl.ControlRTS = rtsDisable FlowControl.ControlRTS = rtsDisable
FlowControl.XonXoffOut = False FlowControl.XonXoffOut = False
FlowControl.XonXoffIn = False FlowControl.XonXoffIn = False
OnAfterOpen = ComPortAfterOpen
OnAfterClose = ComPortAfterClose
OnRxChar = ComPortRxChar
OnRxFlag = ComPortRxFlag
Left = 160 Left = 160
Top = 120 Top = 120
end end

View File

@ -8,7 +8,6 @@ uses
type type
TForm1 = class(TForm) TForm1 = class(TForm)
ComPort: TComPort;
COMSettings: TButton; COMSettings: TButton;
MultiButt: TButton; MultiButt: TButton;
GroupBox1: TGroupBox; GroupBox1: TGroupBox;
@ -57,6 +56,7 @@ type
GraphDelayCtrl: TEdit; GraphDelayCtrl: TEdit;
Label13: TLabel; Label13: TLabel;
DelayTimer: TTimer; DelayTimer: TTimer;
ComPort: TComPort;
procedure COMSettingsClick(Sender: TObject); procedure COMSettingsClick(Sender: TObject);
procedure MultiButtClick(Sender: TObject); procedure MultiButtClick(Sender: TObject);
procedure ComPortOpen(Sender: TObject); procedure ComPortOpen(Sender: TObject);
@ -248,24 +248,14 @@ begin
Form1.AlphaBlendValue := cf.ReadInteger('Window','AlphaValue',255); Form1.AlphaBlendValue := cf.ReadInteger('Window','AlphaValue',255);
Form1.AlphaBlend := cf.ReadBool('Window','AlphaBlend',false); Form1.AlphaBlend := cf.ReadBool('Window','AlphaBlend',false);
Form1.ComPort.Port := TPortType(cf.ReadInteger('Communication','Port',0)-1); with Form1 do begin
Form1.ComPort.BaudRate := TBaudRate(cf.ReadInteger('Communication','BaudRate',6)); ComPort.Port := cf.ReadString('Communication','Port','COM1');
Form1.ComPort.DataBits := TDataBits(cf.ReadInteger('Communication','DataBits',3)); ComPort.BaudRate := StrToBaudRate(cf.ReadString('Communication','BaudRate','9600'));
Form1.ComPort.StopBits := TStopBits(cf.ReadInteger('Communication','StopBits',0)); ComPort.DataBits := StrToDataBits(cf.ReadString('Communication','DataBits','8'));
Form1.ComPort.Parity.Bits := TParityBits(cf.ReadInteger('Communication','Parity.Bits',0)); ComPort.StopBits := StrToStopBits(cf.ReadString('Communication','StopBits','1'));
Form1.ComPort.Parity.Check := cf.ReadBool('Communication','Parity.Check',false); ComPort.Parity.Bits := StrToParity(cf.ReadString('Communication','Parity','None'));
Form1.ComPort.Parity.Replace := cf.ReadBool('Communication','Parity.Replace',false); ComPort.FlowControl.FlowControl := StrToFlowControl(cf.ReadString('Communication','FlowControl',''));
Form1.ComPort.Parity.ReplaceChar := cf.ReadInteger('Communication','Parity.ReplaceChar',0); end;
Form1.ComPort.FlowControl.ControlDTR := TDTRFlowControl(cf.ReadInteger('Communication','FlowControl.DTR',1));
Form1.ComPort.FlowControl.ControlRTS := TRTSFlowControl(cf.ReadInteger('Communication','FlowControl.RTS',0));
Form1.ComPort.FlowControl.DSRSensitivity := cf.ReadBool('Communication','FlowControl.DSRSensitivity',false);
Form1.ComPort.FlowControl.OutCTSFlow := cf.ReadBool('Communication','FlowControl.OutCTSFlow',false);
Form1.ComPort.FlowControl.OutDSRFlow := cf.ReadBool('Communication','FlowControl.OutDSRFlow',false);
Form1.ComPort.FlowControl.TxContinueOnXoff := cf.ReadBool('Communication','FlowControl.TxContinueOnXoff',false);
Form1.ComPort.FlowControl.XoffChar := cf.ReadInteger('Communication','FlowControl.XoffChar',19);
Form1.ComPort.FlowControl.XonChar := cf.ReadInteger('Communication','FlowControl.XonChar',17);
Form1.ComPort.FlowControl.XonXoffIn := cf.ReadBool('Communication','FlowControl.XonXoffIn',false);
Form1.ComPort.FlowControl.XonXoffOut := cf.ReadBool('Communication','FlowControl.XonXoffOut',false);
GraphDelay := cf.ReadInteger('Slots','GraphDelay',60); GraphDelay := cf.ReadInteger('Slots','GraphDelay',60);
Form1.GraphDelayBar.Position := 300-GraphDelay; Form1.GraphDelayBar.Position := 300-GraphDelay;
@ -287,24 +277,14 @@ var cf: TIniFile;
begin begin
try try
cf := TIniFile.Create(ChangeFileExt(Application.ExeName,'.ini')); cf := TIniFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
cf.WriteInteger('Communication','Port',Ord(Form1.ComPort.Port)+1); with Form1 do begin
cf.WriteInteger('Communication','BaudRate',Ord(Form1.ComPort.BaudRate)); cf.WriteString('Communication', 'Port', ComPort.Port);
cf.WriteInteger('Communication','DataBits',Ord(Form1.ComPort.DataBits)); cf.WriteString('Communication', 'BaudRate', BaudRateToStr(ComPort.BaudRate));
cf.WriteInteger('Communication','StopBits',Ord(Form1.ComPort.StopBits)); cf.WriteString('Communication', 'DataBits', DataBitsToStr(ComPort.DataBits));
cf.WriteInteger('Communication','Parity.Bits',Ord(Form1.ComPort.Parity.Bits)); cf.WriteString('Communication', 'StopBits', StopBitsToStr(ComPort.StopBits));
cf.WriteBool('Communication','Parity.Check',Form1.ComPort.Parity.Check); cf.WriteString('Communication', 'Parity', ParityToStr(ComPort.Parity.Bits));
cf.WriteBool('Communication','Parity.Replace',Form1.ComPort.Parity.Replace); cf.WriteString('Communication', 'FlowControl', FlowControlToStr(ComPort.FlowControl.FlowControl));
cf.WriteInteger('Communication','Parity.ReplaceChar',Form1.ComPort.Parity.ReplaceChar); end;
cf.WriteInteger('Communication','FlowControl.DTR',Ord(Form1.ComPort.FlowControl.ControlDTR));
cf.WriteInteger('Communication','FlowControl.RTS',Ord(Form1.ComPort.FlowControl.ControlRTS));
cf.WriteBool('Communication','FlowControl.DSRSensitivity',Form1.ComPort.FlowControl.DSRSensitivity);
cf.WriteBool('Communication','FlowControl.OutCTSFlow',Form1.ComPort.FlowControl.OutCTSFlow);
cf.WriteBool('Communication','FlowControl.OutDSRFlow',Form1.ComPort.FlowControl.OutDSRFlow);
cf.WriteBool('Communication','FlowControl.TxContinueOnXoff',Form1.ComPort.FlowControl.TxContinueOnXoff);
cf.WriteInteger('Communication','FlowControl.XoffChar',Form1.ComPort.FlowControl.XoffChar);
cf.WriteInteger('Communication','FlowControl.XonChar',Form1.ComPort.FlowControl.XonChar);
cf.WriteBool('Communication','FlowControl.XonXoffIn',Form1.ComPort.FlowControl.XonXoffIn);
cf.WriteBool('Communication','FlowControl.XonXoffOut',Form1.ComPort.FlowControl.XonXoffOut);
cf.WriteInteger('Slots','GraphDelay',GraphDelay); cf.WriteInteger('Slots','GraphDelay',GraphDelay);
cf.WriteInteger('Slots','1.Color',Ord(GraphCol[1])); cf.WriteInteger('Slots','1.Color',Ord(GraphCol[1]));

View File

@ -7,21 +7,9 @@ Port=COM1
BaudRate=9600 BaudRate=9600
DataBits=8 DataBits=8
StopBits=1 StopBits=1
Parity.Bits=None
FlowControl=Software
Parity=None Parity=None
Parity.Check=0
Parity.Replace=0
Parity.ReplaceChar=0
FlowControl=None
FlowControl.DTR=1
FlowControl.RTS=0
FlowControl.DSRSensitivity=0
FlowControl.OutCTSFlow=0
FlowControl.OutDSRFlow=0
FlowControl.TxContinueOnXoff=0
FlowControl.XoffChar=19
FlowControl.XonChar=17
FlowControl.XonXoffIn=0
FlowControl.XonXoffOut=0
[Slots] [Slots]
1.Color=16711680 1.Color=16711680
@ -29,35 +17,3 @@ FlowControl.XonXoffOut=0
3.Color=32768 3.Color=32768
4.Color=16711935 4.Color=16711935
GraphDelay=75 GraphDelay=75
;BELOW HERE IS FOR FUTURE ONLY
[Models]
cm2010="Charge Manager 2010"
cm2020="Charge Manager 2020"
[Model.cm2010]
Slots=4
RecordLength=34
Byte.SlotNo=1
Byte.Disp=2L
Byte.BattType=3H
Byte.Progress=3L
Byte.Counter=5
Byte.Hours=6
Byte.Minutes=7
Byte.Current=14-15
Byte.Voltage=16-17
Byte.CCap=18-20
Byte.DCap=21-23
Byte.Resi=33-34
[Model.cm2020]
Slots=10
RecordLength=22
Byte.SlotNo=1
Byte.Disp=4L
Byte.Progress=5L
Byte.CCap=6-8
Byte.DCap=9-11
Byte.