mirror of
https://github.com/mbirth/cm2010.git
synced 2024-12-24 03:14:07 +00: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:
parent
7f5c144e5b
commit
f601b97d53
285
CM2010.dfm
285
CM2010.dfm
@ -1,7 +1,7 @@
|
||||
object Form1: TForm1
|
||||
Left = 195
|
||||
Top = 109
|
||||
Width = 716
|
||||
Left = 197
|
||||
Top = 176
|
||||
Width = 721
|
||||
Height = 477
|
||||
Caption =
|
||||
'Charge Manager 2010 --- (c)2003 by Markus Birth <mbirth@webwrite' +
|
||||
@ -135,66 +135,6 @@ object Form1: TForm1
|
||||
Height = 13
|
||||
Caption = 'secs'
|
||||
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
|
||||
Left = 648
|
||||
Top = 256
|
||||
@ -245,163 +185,46 @@ object Form1: TForm1
|
||||
Height = 73
|
||||
Caption = 'COM Status'
|
||||
TabOrder = 2
|
||||
object Label1: TLabel
|
||||
Left = 30
|
||||
Top = 16
|
||||
Width = 71
|
||||
object L_CTS: TLabel
|
||||
Left = 8
|
||||
Top = 20
|
||||
Width = 44
|
||||
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
|
||||
object L_Time: TLabel
|
||||
Left = 110
|
||||
Top = 16
|
||||
Left = 80
|
||||
Top = 40
|
||||
Width = 73
|
||||
Height = 13
|
||||
Alignment = taCenter
|
||||
AutoSize = False
|
||||
Caption = 'hh:mm:ss'
|
||||
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
|
||||
object Edit1: TEdit
|
||||
Left = 64
|
||||
@ -510,7 +333,7 @@ object Form1: TForm1
|
||||
object StatusBar: TStatusBar
|
||||
Left = 0
|
||||
Top = 431
|
||||
Width = 708
|
||||
Width = 713
|
||||
Height = 19
|
||||
Panels = <>
|
||||
SimplePanel = True
|
||||
@ -651,38 +474,6 @@ object Form1: TForm1
|
||||
OnChange = GraphDelayCtrlChange
|
||||
OnKeyDown = GraphDelayCtrlKeyDown
|
||||
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
|
||||
Left = 664
|
||||
Top = 112
|
||||
@ -707,10 +498,6 @@ object Form1: TForm1
|
||||
FlowControl.ControlRTS = rtsDisable
|
||||
FlowControl.XonXoffOut = False
|
||||
FlowControl.XonXoffIn = False
|
||||
OnAfterOpen = ComPortAfterOpen
|
||||
OnAfterClose = ComPortAfterClose
|
||||
OnRxChar = ComPortRxChar
|
||||
OnRxFlag = ComPortRxFlag
|
||||
Left = 160
|
||||
Top = 120
|
||||
end
|
||||
|
54
CM2010.pas
54
CM2010.pas
@ -8,7 +8,6 @@ uses
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
ComPort: TComPort;
|
||||
COMSettings: TButton;
|
||||
MultiButt: TButton;
|
||||
GroupBox1: TGroupBox;
|
||||
@ -57,6 +56,7 @@ type
|
||||
GraphDelayCtrl: TEdit;
|
||||
Label13: TLabel;
|
||||
DelayTimer: TTimer;
|
||||
ComPort: TComPort;
|
||||
procedure COMSettingsClick(Sender: TObject);
|
||||
procedure MultiButtClick(Sender: TObject);
|
||||
procedure ComPortOpen(Sender: TObject);
|
||||
@ -248,24 +248,14 @@ begin
|
||||
Form1.AlphaBlendValue := cf.ReadInteger('Window','AlphaValue',255);
|
||||
Form1.AlphaBlend := cf.ReadBool('Window','AlphaBlend',false);
|
||||
|
||||
Form1.ComPort.Port := TPortType(cf.ReadInteger('Communication','Port',0)-1);
|
||||
Form1.ComPort.BaudRate := TBaudRate(cf.ReadInteger('Communication','BaudRate',6));
|
||||
Form1.ComPort.DataBits := TDataBits(cf.ReadInteger('Communication','DataBits',3));
|
||||
Form1.ComPort.StopBits := TStopBits(cf.ReadInteger('Communication','StopBits',0));
|
||||
Form1.ComPort.Parity.Bits := TParityBits(cf.ReadInteger('Communication','Parity.Bits',0));
|
||||
Form1.ComPort.Parity.Check := cf.ReadBool('Communication','Parity.Check',false);
|
||||
Form1.ComPort.Parity.Replace := cf.ReadBool('Communication','Parity.Replace',false);
|
||||
Form1.ComPort.Parity.ReplaceChar := cf.ReadInteger('Communication','Parity.ReplaceChar',0);
|
||||
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);
|
||||
with Form1 do begin
|
||||
ComPort.Port := cf.ReadString('Communication','Port','COM1');
|
||||
ComPort.BaudRate := StrToBaudRate(cf.ReadString('Communication','BaudRate','9600'));
|
||||
ComPort.DataBits := StrToDataBits(cf.ReadString('Communication','DataBits','8'));
|
||||
ComPort.StopBits := StrToStopBits(cf.ReadString('Communication','StopBits','1'));
|
||||
ComPort.Parity.Bits := StrToParity(cf.ReadString('Communication','Parity','None'));
|
||||
ComPort.FlowControl.FlowControl := StrToFlowControl(cf.ReadString('Communication','FlowControl',''));
|
||||
end;
|
||||
|
||||
GraphDelay := cf.ReadInteger('Slots','GraphDelay',60);
|
||||
Form1.GraphDelayBar.Position := 300-GraphDelay;
|
||||
@ -287,24 +277,14 @@ var cf: TIniFile;
|
||||
begin
|
||||
try
|
||||
cf := TIniFile.Create(ChangeFileExt(Application.ExeName,'.ini'));
|
||||
cf.WriteInteger('Communication','Port',Ord(Form1.ComPort.Port)+1);
|
||||
cf.WriteInteger('Communication','BaudRate',Ord(Form1.ComPort.BaudRate));
|
||||
cf.WriteInteger('Communication','DataBits',Ord(Form1.ComPort.DataBits));
|
||||
cf.WriteInteger('Communication','StopBits',Ord(Form1.ComPort.StopBits));
|
||||
cf.WriteInteger('Communication','Parity.Bits',Ord(Form1.ComPort.Parity.Bits));
|
||||
cf.WriteBool('Communication','Parity.Check',Form1.ComPort.Parity.Check);
|
||||
cf.WriteBool('Communication','Parity.Replace',Form1.ComPort.Parity.Replace);
|
||||
cf.WriteInteger('Communication','Parity.ReplaceChar',Form1.ComPort.Parity.ReplaceChar);
|
||||
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);
|
||||
with Form1 do begin
|
||||
cf.WriteString('Communication', 'Port', ComPort.Port);
|
||||
cf.WriteString('Communication', 'BaudRate', BaudRateToStr(ComPort.BaudRate));
|
||||
cf.WriteString('Communication', 'DataBits', DataBitsToStr(ComPort.DataBits));
|
||||
cf.WriteString('Communication', 'StopBits', StopBitsToStr(ComPort.StopBits));
|
||||
cf.WriteString('Communication', 'Parity', ParityToStr(ComPort.Parity.Bits));
|
||||
cf.WriteString('Communication', 'FlowControl', FlowControlToStr(ComPort.FlowControl.FlowControl));
|
||||
end;
|
||||
|
||||
cf.WriteInteger('Slots','GraphDelay',GraphDelay);
|
||||
cf.WriteInteger('Slots','1.Color',Ord(GraphCol[1]));
|
||||
|
@ -7,21 +7,9 @@ Port=COM1
|
||||
BaudRate=9600
|
||||
DataBits=8
|
||||
StopBits=1
|
||||
Parity.Bits=None
|
||||
FlowControl=Software
|
||||
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]
|
||||
1.Color=16711680
|
||||
@ -29,35 +17,3 @@ FlowControl.XonXoffOut=0
|
||||
3.Color=32768
|
||||
4.Color=16711935
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user