goo blog サービス終了のお知らせ 

インターネット巡回生活

ほぼほぼ、書きなぐり雑記かも

RRT その5

2009-12-23 | 日常


TrayIcon2.balloontitle:= ReleaseNo;
Timer1.Interval := 0;
Timer1.Enabled := false;
strWork:=FloatToStrF(int(WkChkDateTime),ffFixed,10,0);

WkZipStartSerial:=(( strtoint(strwork) * 24 * 60 ) - 36819900 )
+ StrToInt(DtEdit1_1[WkChkPoint]) * 60 +
StrToInt(DtEdit1_2[WkChkPoint]);
WkZipEndSerial:= wkZipStartSerial + StrToInt(DtEdit2[WkChkPoint]);
WkZipStartSerial := WkZipStartSerial* 60;
WkZipEndSerial := WkZipEndSerial * 60;
// showmessage(ExtractFileDir(Edit_srec.text) + '\srec.ini' +' ' + inttostr(WkZipStartSerial));
inifile :=Tinifile.Create(ExtractFileDir(Edit_srec.text) + '\srec.ini');
inifile.writeString('RRTadd','RecTempFolder',DtEdit3[WkChkPoint]) ;
inifile.writeString('RRTadd','RecFolder',DtEdit3[WkChkPoint]) ;
if DtEdit4_2[WkchkPoint] = '' then
DtEdit4_2[WkchkPoint]:= '_';
inifile.writeString('RRTadd','RecFilePre',DtEdit4_1[WkChkPoint]
+ FormatDateTime(DtEdit4_2[WkChkPoint],WkchkDateTime)) ;

inifile.writeinteger('RRTadd','TIMER_ENABLE',1) ;
inifile.writeinteger('RRTadd','TM_START',WkZipStartSerial) ;
inifile.writeinteger('RRTadd','TM_END',WkZipEndSerial) ;
inifile.writeinteger('RRTadd','TM_POWERDOWN',0) ;
inifile.free;


Application.ProcessMessages;
// 'edit
{現在のプログラムのスタートアップ情報を取得}
GetStartupInfo(SI);

{他のアプリケーションの起動}
if not CreateProcess(PChar(edit_srec.text), nil, nil, nil, False,
CREATE_DEFAULT_ERROR_MODE, nil, nil, SI,PI) then

{CreateProcess が False を返したときはエラー}
raise Exception.Create('srec を起動できません');

Button1.Enabled := False;
StatusBar1.simpleText := '実行中';
StatusBar1.Show;
Application.ProcessMessages;
// 終了待ち(10秒待つけど、正常終了までLOOP)
repeat
begin
ecode := WaitForSingleObject(PI.hProcess, 10000);
Application.ProcessMessages;

end;
until ecode = WAIT_OBJECT_0;
StatusBar1.simpleText := '';
StatusBar1.Show;

(*
for i := 0 to 1000 do
begin
// ecode := WaitForInputIdle(PI.hProcess, 10000);
ecode := WaitForSingleObject(PI.hProcess, 10000);
if ecode = WAIT_OBJECT_0 then break;
if ecode = WAIT_TIMEOUT then break;
Application.ProcessMessages;
end;
*)
(*
// メッセージ表示
for i := 0 to 1000 do
begin
ecode := WaitForSingleObject(PI.hProcess, 10000);
if ecode = WAIT_OBJECT_0 then break;
if ecode = WAIT_TIMEOUT then break;

Application.ProcessMessages;
end;
*)

(*
appActivate('S Rec');
SendKeys('{TAB}{TAB}',true);
SendKeys('EN050421_{TAB}',true);
for i :=1 to 12 do
begin
SendKeys('{TAB}',true)
end;
SendKeys('2005/4/21{TAB}',false);
SendKeys('14:15:00{TAB}{TAB}{TAB}',false);
SendKeys('15{TAB}',false); //
SendKeys('{ENTER}',false);

ecode := WaitForSingleObject(PI.hProcess,INFINITE);


// ボタンを有効化
*)

jump_end:
Button1.Enabled := True;
Timer1.Interval := GlTimerInterval * 1000;
Timer1.Enabled := True;

end;


procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
if radiogroup1.ItemIndex <> 0 then
groupBox1.font.color:= clGradientInactiveCaption
else
groupBox1.font.color:= clWindowText;

// showmessage('radigroup1');
groupBox1.show;
// showmessage('radigroup1');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
openDialog1.Execute;
edit_srec.Text:= openDialog1.FileName;

end;

procedure TForm1.Button3Click(Sender: TObject);
begin
// application.Minimize;
Form1.Hide;
trayicon2.Visible:=true;

end;

procedure TForm1.RadioGroup2Click(Sender: TObject);
begin
if radiogroup2.ItemIndex <> 0 then
groupBox2.font.color:= clGradientInactiveCaption
else
groupBox2.font.color:= clWindowText;

groupBox2.show;
end;

procedure TForm1.RadioGroup3Click(Sender: TObject);
begin
if radiogroup3.ItemIndex <> 0 then
groupBox3.font.color:= clGradientInactiveCaption
else
groupBox3.font.color:= clWindowText;

groupBox3.show;

end;
procedure TForm1.RadioGroup4Click(Sender: TObject);
begin
if radiogroup4.ItemIndex <> 0 then
groupBox4.font.color:= clGradientInactiveCaption
else
groupBox4.font.color:= clWindowText;

groupBox4.show;

end;

procedure TForm1.RadioGroup5Click(Sender: TObject);
begin
if radiogroup5.ItemIndex <> 0 then
groupBox5.font.color:= clGradientInactiveCaption
else
groupBox5.font.color:= clWindowText;

groupBox5.show;

end;
procedure TForm1.Label4Click(Sender: TObject);
begin
HlinkNavigateString(nil,'http://www.geocities.jp/buriburipipi/');
end;

procedure TForm1.Label5Click(Sender: TObject);
begin
HlinkNavigateString(nil,'http://blog.goo.ne.jp/buriburipipi');
end;

procedure TForm1.FormActivate(Sender: TObject);
begin
if Edit_srec.Text ='右のボタンを押してsrec70.exe を探してください' then
Form1.PageControl1.ActivePageIndex:=1;
end;

procedure TForm1.Block1Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block1Edit3.Text := Dir;
end;

procedure TForm1.Block2Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block2Edit3.Text := Dir;
end;

procedure TForm1.Block3Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block3Edit3.Text := Dir;
end;



procedure TForm1.Block4Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block4Edit3.Text := Dir;
end;

procedure TForm1.Block5Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block5Edit3.Text := Dir;
end;

procedure TForm1.Timer2Timer(Sender: TObject);
begin
// Timer2.Interval := GlTimerInterval * 1000;
Timer2.Enabled := false;

if checkbox2.Checked then
begin
// Application.Minimize;
// Application.
// trayicon2.Visible:=true;
// Form1.Hide;
/// ShowMessage('timmer start');
button3.click;
end;

end;

end.

コメント (4)
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

RRTソース4

2009-12-23 | 日常

procedure TForm1.TrayIcon2DblClick(Sender: TObject);
begin

Application.Restore;
form1.Show;
trayicon2.Visible:=false;

// 1.2.0.7 add
if checkbox2.Checked then
begin
Timer2.Interval := GlHiddenInterval * 1000;
Timer2.Enabled := true;
end;
//end

end;


procedure TForm1.Timer1Timer(Sender: TObject);

var i,Cnt : integer;
ecode : Integer;
var
Inifile: Tinifile;
var
SI: TStartupInfo;
PI: TprocessInformation;
WkNowDateTime : tdatetime;
WkSetDateTime : tdatetime;
WkNowDateTimeYear : integer;
WkNowDateTimeMonth : integer;
WkNowDateTimeDay : integer;
WkNowDateTimeHour : integer;
WkNowDateTimeMinute: integer;
WkNowDateTimeSecond: integer;
WkNowDateTimeWeek : integer;

WkZipStartSerial,WkZipEndSerial :integer;

WkYoyaku,WkNow,WkNextFlag,WkStartChk ,WkHit,
WkStartChkFirst,WkHitDayPoint:integer;
WkStrDateTime,strWork: string;
var
DtFlagOn: array[1..5] of boolean;
DtSpeedButton : array[1..5,1..7] of boolean;
DtEdit1_1 : array[1..5] of string;
DtEdit1_2 : array[1..5] of string;
DtEdit2 : array[1..5] of string;
DtEdit3 : array[1..5] of string;
DtEdit4_1 : array[1..5] of string;
DtEdit4_2 : array[1..5] of string;
var
WkChkDateTime : tdatetime;
WkChkPoint : integer;
//1.1.2.6 add
TargetWnd : HWND;
WkWaitDateTime : tdatetime;
WkLoopCnt : Integer;
//1.1.2.6 addend
label jump_end;
begin
Timer1.Interval := 0;
WkNowDateTime := IncSecond(now(),GlPreIdol1);
WkNowDateTimeYear := YearOf(WkNowDateTime);
WkNowDateTimeMonth := MonthOf(WkNowDateTime);
WkNowDateTimeDay := DayOf(WkNowDateTime);
WkNowDateTimeHour := HourOf(WkNowDateTime);
WkNowDateTimeMinute:= MinuteOf(WkNowDateTime);
WkNowDateTimeSecond:= SecondOf(WkNowDateTime);
WkNowDateTimeWeek := DayOfTheWeek(WkNowDateTime);
wkNow := WkNowDateTimeHour * 10000 + WkNowDateTimeMinute * 100 +
WkNowDateTimeSecond;

//
if RadioGroup1.ItemIndex = 0 then
begin
DtFlagOn[1] := True;
Dtspeedbutton[1,1] := Block1Speedbutton1.down;
Dtspeedbutton[1,2] := Block1Speedbutton2.down;
Dtspeedbutton[1,3] := Block1Speedbutton3.down;
Dtspeedbutton[1,4] := Block1Speedbutton4.down;
Dtspeedbutton[1,5] := Block1Speedbutton5.down;
Dtspeedbutton[1,6] := Block1Speedbutton6.down;
Dtspeedbutton[1,7] := Block1Speedbutton7.down;
DtEdit1_1[1] := Block1Edit1_1.Text;
DtEdit1_2[1] := Block1Edit1_2.Text;
DtEdit2[1] := Block1Edit2.text;
DtEdit3[1] := Block1Edit3.Text;
DtEdit4_1[1] := Block1Edit4_1.Text;
DtEdit4_2[1] := Block1Edit4_2.Text;
end
else
begin
DtFlagOn[1] := False
end;
if RadioGroup2.ItemIndex = 0 then
begin
DtFlagOn[2] := True;
Dtspeedbutton[2,1] := Block2Speedbutton1.down;
Dtspeedbutton[2,2] := Block2Speedbutton2.down;
Dtspeedbutton[2,3] := Block2Speedbutton3.down;
Dtspeedbutton[2,4] := Block2Speedbutton4.down;
Dtspeedbutton[2,5] := Block2Speedbutton5.down;
Dtspeedbutton[2,6] := Block2Speedbutton6.down;
Dtspeedbutton[2,7] := Block2Speedbutton7.down;
DtEdit1_1[2] := Block2Edit1_1.Text;
DtEdit1_2[2] := Block2Edit1_2.Text;
DtEdit2[2] := Block2Edit2.text;
DtEdit3[2] := Block2Edit3.Text;
DtEdit4_1[2] := Block2Edit4_1.Text;
DtEdit4_2[2] := Block2Edit4_2.Text;
end
else
begin
DtFlagOn[2] := False;
end;
if RadioGroup3.ItemIndex = 0 then
begin
DtFlagOn[3] := True;
Dtspeedbutton[3,1] := Block3Speedbutton1.down;
Dtspeedbutton[3,2] := Block3Speedbutton2.down;
Dtspeedbutton[3,3] := Block3Speedbutton3.down;
Dtspeedbutton[3,4] := Block3Speedbutton4.down;
Dtspeedbutton[3,5] := Block3Speedbutton5.down;
Dtspeedbutton[3,6] := Block3Speedbutton6.down;
Dtspeedbutton[3,7] := Block3Speedbutton7.down;
DtEdit1_1[3] := Block3Edit1_1.Text;
DtEdit1_2[3] := Block3Edit1_2.Text;
DtEdit2[3] := Block3Edit2.text;
DtEdit3[3] := Block3Edit3.Text;
DtEdit4_1[3] := Block3Edit4_1.Text;
DtEdit4_2[3] := Block3Edit4_2.Text;
end
else
begin
DtFlagOn[3] := False ;
end;
if RadioGroup4.ItemIndex = 0 then
begin
DtFlagOn[4] := True;
Dtspeedbutton[4,1] := Block4Speedbutton1.down;
Dtspeedbutton[4,2] := Block4Speedbutton2.down;
Dtspeedbutton[4,3] := Block4Speedbutton3.down;
Dtspeedbutton[4,4] := Block4Speedbutton4.down;
Dtspeedbutton[4,5] := Block4Speedbutton5.down;
Dtspeedbutton[4,6] := Block4Speedbutton6.down;
Dtspeedbutton[4,7] := Block4Speedbutton7.down;
DtEdit1_1[4] := Block4Edit1_1.Text;
DtEdit1_2[4] := Block4Edit1_2.Text;
DtEdit2[4] := Block4Edit2.text;
DtEdit3[4] := Block4Edit3.Text;
DtEdit4_1[4] := Block4Edit4_1.Text;
DtEdit4_2[4] := Block4Edit4_2.Text;
end
else
begin
DtFlagOn[4] := False ;
end;
if RadioGroup5.ItemIndex = 0 then
begin
DtFlagOn[5] := True;
Dtspeedbutton[5,1] := Block5Speedbutton1.down;
Dtspeedbutton[5,2] := Block5Speedbutton2.down;
Dtspeedbutton[5,3] := Block5Speedbutton3.down;
Dtspeedbutton[5,4] := Block5Speedbutton4.down;
Dtspeedbutton[5,5] := Block5Speedbutton5.down;
Dtspeedbutton[5,6] := Block5Speedbutton6.down;
Dtspeedbutton[5,7] := Block5Speedbutton7.down;
DtEdit1_1[5] := Block5Edit1_1.Text;
DtEdit1_2[5] := Block5Edit1_2.Text;
DtEdit2[5] := Block5Edit2.text;
DtEdit3[5] := Block5Edit3.Text;
DtEdit4_1[5] := Block5Edit4_1.Text;
DtEdit4_2[5] := Block5Edit4_2.Text;
end
else
begin
DtFlagOn[5] := False ;
end;

WkChkPoint :=0;
WkChkDateTime:= 99999;
for Cnt := 1 to 5 do
begin
if not DtFlagOn[Cnt] then
Continue;
WkYoyaku := StrToInt(DtEdit1_1[Cnt]) * 10000 +
StrToInt(DtEdit1_2[Cnt]) * 100;
if WkYoyaku <WkNow then else
WkNextFlag := 0;
wkStartChk:= WkNowDateTimeWeek + WkNextFlag;
if WkStartChk > 7 then
WkStartChk := WkStartChk - 7;
WkHit := 0;
if Dtspeedbutton[Cnt,WkStartChk] then
begin
WkHit := 1;
WkSetDateTime:=WkNowDateTime + WkNextFlag;
WkSetDateTime:= StrToDatetime(DateToStr(WkSetDateTime) + ' '
+ DtEdit1_1[Cnt] + ':' + DtEdit1_2[Cnt] + ':00');

if WkChkDateTime > WkSetDateTime then
begin
WkChkPoint := Cnt ;
WkChkDateTime := WkSetDateTime ;
end;
end;
end;
// TrayIcon2.balloontitle:= ReleaseNo;
TrayIcon2.hint:= ReleaseNo;

if WkChkPoint = 0 then goto jump_end;
StatusBar1.SimpleText:=
DateTimeToStr(WkChkDateTime) +
'='+ inttostr(MinutesBetween( WkNowDateTime,WkChkDateTime))
+ '分後に予約開始時刻' ;
StatusBar1.Show;
// TrayIcon2.balloontitle:= ReleaseNo+ #$13 + #$10 + DateTimeToStr(WkChkDateTime)
// + #$13 + #$10 + inttostr(MinutesBetween( WkNowDateTime,WkChkDateTime))
// + '分後に予約開始時刻';
TrayIcon2.hint:= StatusBar1.SimpleText;
// trayicon2.

if SecondsBetween( WkNowDateTime,WkChkDateTime) > GlPreIdol2 then
goto jump_end;

// 1.1.2.6 add
if CheckBox1.Checked then
begin
StatusBar1.SimpleText:= 'S Rec Terminate';
StatusBar1.Show;
TargetWnd:=FindWindow(nil,'S Rec');
WkLoopCnt := 0;
while(TargetWnd>0) do
begin
PostMessage(TargetWnd,WM_CLOSE,0,0);
Application.ProcessMessages;
sleep(5000);
TargetWnd:=FindWindow(nil,'S Rec') ;
WkLoopCnt := WkLoopCnt + 1;
end;
if WkLoopCnt > 1 then goto jump_end;
end;
// addend
コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

RRTソース その3

2009-12-23 | 日常
// BlockのFont色をOn/Offする
procedure Block1FontUpdate;
begin
if form1.radiogroup1.ItemIndex <> 0 then
form1.groupBox1.font.color:= clGradientInactiveCaption
else
form1.groupBox1.font.color:= clWindowText;
Form1.Groupbox1.show;

end;
procedure Block2FontUpdate;
begin
if form1.radiogroup2.ItemIndex <> 0 then
form1.groupBox2.font.color:= clGradientInactiveCaption
else
form1.groupBox2.font.color:= clWindowText;
Form1.Groupbox2.show;



end;
procedure Block3FontUpdate;
begin
if form1.radiogroup3.ItemIndex <> 0 then
form1.groupBox3.font.color:= clGradientInactiveCaption
else
form1.groupBox3.font.color:= clWindowText;
Form1.Groupbox3.show;

end;

procedure Block4FontUpdate;
begin
if form1.radiogroup4.ItemIndex <> 0 then
form1.groupBox4.font.color:= clGradientInactiveCaption
else
form1.groupBox4.font.color:= clWindowText;
Form1.Groupbox4.show;

end;
procedure Block5FontUpdate;
begin
if form1.radiogroup5.ItemIndex <> 0 then
form1.groupBox5.font.color:= clGradientInactiveCaption
else
form1.groupBox5.font.color:= clWindowText;
Form1.Groupbox5.show;

end;


procedure TForm1.Button1Click(Sender: TObject);
var
i : integer;
begin
Timer1.Interval := 1000;
inifile_update();
end;




procedure TForm1.FormCreate(Sender: TObject);
var
Inifile: Tinifile;
const
CErorr: integer = -1;
var ret :integer;
begin
ReleaseNo:='RadioRecodingTimer 1.2.1.8';
// 最小化でタスクトレイへ入れる
TrayIcon2.visible:=false ;
// TrayIcon1.HideOnTaskBar :=true;
// // CR(#$13) + LF(#$10)
TrayIcon2.balloontitle:= ReleaseNo;
Label2.Caption:= ReleaseNo;
// TrayIcon1.ShowBalloonHelpSE('RadioRecodingTimer 0.1.2.0',
// '',50,bitNone);
if not FileExists(ChangeFileExt(paramStr(0),'.ini')) then
begin
// PageControl1.TabIndex := 1;
// PageControl1.ActivePageIndex:=2;
if FileExists(ExtractFileDir(paramStr(0)) + '\srec70.exe') then
Edit_srec.text:=ExtractFileDir(paramStr(0)) + '\srec70.exe'
else if FileExists(ExtractFileDir(paramStr(0)) + '\srec70h1.exe') then
Edit_srec.text:=ExtractFileDir(paramStr(0)) + '\srec70h1.exe'
else Edit_srec.Text:='右のボタンを押してsrec70.exe を探してください';
end;
inifile :=Tinifile.Create(ChangeFileExt(paramStr(0),'.ini'));
//block1読み込み
RadioGroup1.ItemIndex:=inifile.readinteger('Block1','Mode',1) ;
Block1speedbutton1.down:= inifile.readbool('Block1','WeekMon',FALSE);
Block1speedbutton2.down:= inifile.readbool('Block1','WeekTue',FALSE);
Block1speedbutton3.down:= inifile.readbool('Block1','WeekWed',FALSE);
Block1speedbutton4.down:= inifile.readbool('Block1','WeekThu',FALSE);
Block1speedbutton5.down:= inifile.readbool('Block1','WeekFri',FALSE);
Block1speedbutton6.down:= inifile.readbool('Block1','WeekSat',FALSE);
Block1speedbutton7.down:= inifile.readbool('Block1','WeekSun',FALSE);
Block1Edit1_1.text := inifile.readString('Block1','StartTimeHour','00');
Block1Edit1_2.text := inifile.readString('Block1','StartTimeSecond','00');
Block1Edit2.text := inifile.readString('Block1','minute','00');
Block1Edit3.text := inifile.readString('Block1','Folder','');
Block1Edit4_1.text := inifile.readString('Block1','Prefix1','');
Block1Edit4_2.text := inifile.readString('Block1','Prefix2','yyyymmddhhnn_');
//Block2読み込み
RadioGroup2.ItemIndex:=inifile.readinteger('Block2','Mode',1) ;
Block2speedbutton1.down:= inifile.readbool('Block2','WeekMon',FALSE);
Block2speedbutton2.down:= inifile.readbool('Block2','WeekTue',FALSE);
Block2speedbutton3.down:= inifile.readbool('Block2','WeekWed',FALSE);
Block2speedbutton4.down:= inifile.readbool('Block2','WeekThu',FALSE);
Block2speedbutton5.down:= inifile.readbool('Block2','WeekFri',FALSE);
Block2speedbutton6.down:= inifile.readbool('Block2','WeekSat',FALSE);
Block2speedbutton7.down:= inifile.readbool('Block2','WeekSun',FALSE);
Block2Edit1_1.text := inifile.readString('Block2','StartTimeHour','00');
Block2Edit1_2.text := inifile.readString('Block2','StartTimeSecond','00');
Block2Edit2.text := inifile.readString('Block2','minute','00');
Block2Edit3.text := inifile.readString('Block2','Folder','');
Block2Edit4_1.text := inifile.readString('Block2','Prefix1','');
Block2Edit4_2.text := inifile.readString('Block2','Prefix2','yyyymmddhhnn_');
//Block3読み込み
RadioGroup3.ItemIndex:=inifile.readinteger('Block3','Mode',1) ;
Block3speedbutton1.down:= inifile.readbool('Block3','WeekMon',FALSE);
Block3speedbutton2.down:= inifile.readbool('Block3','WeekTue',FALSE);
Block3speedbutton3.down:= inifile.readbool('Block3','WeekWed',FALSE);
Block3speedbutton4.down:= inifile.readbool('Block3','WeekThu',FALSE);
Block3speedbutton5.down:= inifile.readbool('Block3','WeekFri',FALSE);
Block3speedbutton6.down:= inifile.readbool('Block3','WeekSat',FALSE);
Block3speedbutton7.down:= inifile.readbool('Block3','WeekSun',FALSE);
Block3Edit1_1.text := inifile.readString('Block3','StartTimeHour','00');
Block3Edit1_2.text := inifile.readString('Block3','StartTimeSecond','00');
Block3Edit2.text := inifile.readString('Block3','minute','00');
Block3Edit3.text := inifile.readString('Block3','Folder','');
Block3Edit4_1.text := inifile.readString('Block3','Prefix1','');
Block3Edit4_2.text := inifile.readString('Block3','Prefix2','yyyymmddhhnn_');
//Block4読み込み
RadioGroup4.ItemIndex:=inifile.readinteger('Block4','Mode',1) ;
Block4speedbutton1.down:= inifile.readbool('Block4','WeekMon',FALSE);
Block4speedbutton2.down:= inifile.readbool('Block4','WeekTue',FALSE);
Block4speedbutton3.down:= inifile.readbool('Block4','WeekWed',FALSE);
Block4speedbutton4.down:= inifile.readbool('Block4','WeekThu',FALSE);
Block4speedbutton5.down:= inifile.readbool('Block4','WeekFri',FALSE);
Block4speedbutton6.down:= inifile.readbool('Block4','WeekSat',FALSE);
Block4speedbutton7.down:= inifile.readbool('Block4','WeekSun',FALSE);
Block4Edit1_1.text := inifile.readString('Block4','StartTimeHour','00');
Block4Edit1_2.text := inifile.readString('Block4','StartTimeSecond','00');
Block4Edit2.text := inifile.readString('Block4','minute','00');
Block4Edit3.text := inifile.readString('Block4','Folder','');
Block4Edit4_1.text := inifile.readString('Block4','Prefix1','');
Block4Edit4_2.text := inifile.readString('Block4','Prefix2','yyyymmddhhnn_');
//Block5読み込み
RadioGroup5.ItemIndex:=inifile.readinteger('Block5','Mode',1) ;
Block5speedbutton1.down:= inifile.readbool('Block5','WeekMon',FALSE);
Block5speedbutton2.down:= inifile.readbool('Block5','WeekTue',FALSE);
Block5speedbutton3.down:= inifile.readbool('Block5','WeekWed',FALSE);
Block5speedbutton4.down:= inifile.readbool('Block5','WeekThu',FALSE);
Block5speedbutton5.down:= inifile.readbool('Block5','WeekFri',FALSE);
Block5speedbutton6.down:= inifile.readbool('Block5','WeekSat',FALSE);
Block5speedbutton7.down:= inifile.readbool('Block5','WeekSun',FALSE);
Block5Edit1_1.text := inifile.readString('Block5','StartTimeHour','00');
Block5Edit1_2.text := inifile.readString('Block5','StartTimeSecond','00');
Block5Edit2.text := inifile.readString('Block5','minute','00');
Block5Edit3.text := inifile.readString('Block5','Folder','');
Block5Edit4_1.text := inifile.readString('Block5','Prefix1','');
Block5Edit4_2.text := inifile.readString('Block5','Prefix2','yyyymmddhhnn_');

GlPreIdol1 := inifile.readinteger('DEFAULT','PreIdol1',30) ;
GlPreIdol2 := inifile.readinteger('DEFAULT','PreIdol2',180) ;
GlTimerInterval := inifile.readinteger('DEFAULT','TimerInterval',60);
//add 1.1.2.6
CheckBox1.Checked := inifile.readbool('DEFAULT','SRecTerminate',False);
//end
//add 1.2.0.7
CheckBox2.Checked := inifile.readbool('DEFAULT','SRecTrayicon',False);
GlHiddenInterval := inifile.readinteger('DEFAULT','HiddenInterval',300);
//end

Edit_srec.text := inifile.readString('ZipProgram','Name',Edit_srec.text) ;
inifile.free;
Block1FontUpdate();
Block2FontUpdate();
Block3FontUpdate();
Block4FontUpdate();
Block5FontUpdate();
//1.1.1.5 add
Timer1.Interval := GlTimerInterval * 1000;
Timer1.Enabled := True;
//1.2.0.7 add
Timer2.Interval := 10 * 1000;
Timer2.Enabled := True;
//end

if checkbox2.Checked then
begin
// Application.Minimize;
// Application.
// trayicon2.Visible:=true;
// Form1.Hide;
// button3.click;
end;

//end
end;




コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

RRTソース その2

2009-12-23 | 日常
procedure inifile_update();
var
Inifile: Tinifile;
begin

inifile :=Tinifile.Create(ChangeFileExt(paramStr(0),'.ini'));
inifile.writeinteger('Block1','Mode',form1.RadioGroup1.ItemIndex) ;
inifile.Writebool('Block1','WeekMon',form1.BLock1SpeedButton1.down);
inifile.Writebool('Block1','WeekTue',form1.BLock1SpeedButton2.down);
inifile.Writebool('Block1','WeekWed',form1.BLock1SpeedButton3.down);
inifile.Writebool('Block1','WeekThu',form1.BLock1SpeedButton4.down);
inifile.Writebool('Block1','WeekFri',form1.BLock1SpeedButton5.down);
inifile.Writebool('Block1','WeekSat',form1.BLock1SpeedButton6.down);
inifile.Writebool('Block1','WeekSun',form1.BLock1SpeedButton7.down);
inifile.WriteString('Block1','StartTimeHour',form1.Block1Edit1_1.text);
inifile.WriteString('Block1','StartTimeSecond',form1.Block1Edit1_2.text);
inifile.WriteString('Block1','minute',Form1.Block1Edit2.text);
inifile.WriteString('Block1','Folder',Form1.Block1Edit3.text);
inifile.WriteString('Block1','Prefix1',Form1.Block1Edit4_1.text);
inifile.WriteString('Block1','Prefix2',Form1.Block1Edit4_2.text);
inifile.WriteString('ZipProgram','Name',Form1.Edit_srec.text) ;
//1.1.2.6 add
inifile.Writebool('DEFAULT','SRecTerminate',Form1.CheckBox1.Checked);
//end
//1.2.0.7 add
inifile.Writebool('DEFAULT','SRecTrayicon',Form1.CheckBox2.Checked);
inifile.writeinteger('DEFAULT','PreIdol1',GlPreIdol1) ;
inifile.writeinteger('DEFAULT','PreIdol2',GlPreIdol2) ;
inifile.writeinteger('DEFAULT','TimerInterval',GlTimerInterval);
inifile.writeinteger('DEFAULT','HiddenInterval',GlHiddenInterval);
//end
inifile.writeinteger('Block2','Mode',form1.RadioGroup2.ItemIndex) ;
inifile.Writebool('Block2','WeekMon',form1.Block2SpeedButton1.down);
inifile.Writebool('Block2','WeekTue',form1.Block2SpeedButton2.down);
inifile.Writebool('Block2','WeekWed',form1.Block2SpeedButton3.down);
inifile.Writebool('Block2','WeekThu',form1.Block2SpeedButton4.down);
inifile.Writebool('Block2','WeekFri',form1.Block2SpeedButton5.down);
inifile.Writebool('Block2','WeekSat',form1.Block2SpeedButton6.down);
inifile.Writebool('Block2','WeekSun',form1.Block2SpeedButton7.down);
inifile.WriteString('Block2','StartTimeHour',form1.Block2Edit1_1.text);
inifile.WriteString('Block2','StartTimeSecond',form1.Block2Edit1_2.text);
inifile.WriteString('Block2','minute',Form1.Block2Edit2.text);
inifile.WriteString('Block2','Folder',Form1.Block2Edit3.text);
inifile.WriteString('Block2','Prefix1',Form1.Block2Edit4_1.text);
inifile.WriteString('Block2','Prefix2',Form1.Block2Edit4_2.text);
//
inifile.writeinteger('Block3','Mode',form1.RadioGroup3.ItemIndex) ;
inifile.Writebool('Block3','WeekMon',form1.Block3SpeedButton1.down);
inifile.Writebool('Block3','WeekTue',form1.Block3SpeedButton2.down);
inifile.Writebool('Block3','WeekWed',form1.Block3SpeedButton3.down);
inifile.Writebool('Block3','WeekThu',form1.Block3SpeedButton4.down);
inifile.Writebool('Block3','WeekFri',form1.Block3SpeedButton5.down);
inifile.Writebool('Block3','WeekSat',form1.Block3SpeedButton6.down);
inifile.Writebool('Block3','WeekSun',form1.Block3SpeedButton7.down);
inifile.WriteString('Block3','StartTimeHour',form1.Block3Edit1_1.text);
inifile.WriteString('Block3','StartTimeSecond',form1.Block3Edit1_2.text);
inifile.WriteString('Block3','minute',Form1.Block3Edit2.text);
inifile.WriteString('Block3','Folder',Form1.Block3Edit3.text);
inifile.WriteString('Block3','Prefix1',Form1.Block3Edit4_1.text);
inifile.WriteString('Block3','Prefix2',Form1.Block3Edit4_2.text);
//
inifile.writeinteger('Block4','Mode',form1.RadioGroup4.ItemIndex) ;
inifile.Writebool('Block4','WeekMon',form1.Block4SpeedButton1.down);
inifile.Writebool('Block4','WeekTue',form1.Block4SpeedButton2.down);
inifile.Writebool('Block4','WeekWed',form1.Block4SpeedButton3.down);
inifile.Writebool('Block4','WeekThu',form1.Block4SpeedButton4.down);
inifile.Writebool('Block4','WeekFri',form1.Block4SpeedButton5.down);
inifile.Writebool('Block4','WeekSat',form1.Block4SpeedButton6.down);
inifile.Writebool('Block4','WeekSun',form1.Block4SpeedButton7.down);
inifile.WriteString('Block4','StartTimeHour',form1.Block4Edit1_1.text);
inifile.WriteString('Block4','StartTimeSecond',form1.Block4Edit1_2.text);
inifile.WriteString('Block4','minute',Form1.Block4Edit2.text);
inifile.WriteString('Block4','Folder',Form1.Block4Edit3.text);
inifile.WriteString('Block4','Prefix1',Form1.Block4Edit4_1.text);
inifile.WriteString('Block4','Prefix2',Form1.Block4Edit4_2.text);
//
inifile.writeinteger('Block5','Mode',form1.RadioGroup5.ItemIndex) ;
inifile.Writebool('Block5','WeekMon',form1.Block5SpeedButton1.down);
inifile.Writebool('Block5','WeekTue',form1.Block5SpeedButton2.down);
inifile.Writebool('Block5','WeekWed',form1.Block5SpeedButton3.down);
inifile.Writebool('Block5','WeekThu',form1.Block5SpeedButton4.down);
inifile.Writebool('Block5','WeekFri',form1.Block5SpeedButton5.down);
inifile.Writebool('Block5','WeekSat',form1.Block5SpeedButton6.down);
inifile.Writebool('Block5','WeekSun',form1.Block5SpeedButton7.down);
inifile.WriteString('Block5','StartTimeHour',form1.Block5Edit1_1.text);
inifile.WriteString('Block5','StartTimeSecond',form1.Block5Edit1_2.text);
inifile.WriteString('Block5','minute',Form1.Block5Edit2.text);
inifile.WriteString('Block5','Folder',Form1.Block5Edit3.text);
inifile.WriteString('Block5','Prefix1',Form1.Block5Edit4_1.text);
inifile.WriteString('Block5','Prefix2',Form1.Block5Edit4_2.text);

inifile.free;
end;


コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

とりあえず、RRTの最新(笑)ソース

2009-12-23 | 日常
最近、タスクトレイに入れるソフトを会社で作っていて、どーもうまくいかない。
RRTの最新ソース、、もう3年ぐらい前だが、、が欲しくて、ごそごそ見つけたもの。
 その内、HPに上げたいものですけど、、HP作成の環境から作り直さないといけなそうだな、、、

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,IniFiles,
Buttons, ExtCtrls, Menus,FileCtrl,
Spin, ImgList, ComCtrls,dateutils,UrlMon,
sndkey32;

type
TForm1 = class(TForm)

StatusBar1: TStatusBar;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
RadioGroup1: TRadioGroup;
GroupBox1: TGroupBox;
Block1Label1: TLabel;
Block1Label2: TLabel;
Block1Label3: TLabel;
Block1Label4: TLabel;
Block1Edit1_1: TEdit;
Block1Edit2: TEdit;
Block1Edit3: TEdit;
Block1Edit4_1: TEdit;
RadioGroup2: TRadioGroup;
RadioGroup3: TRadioGroup;
Button1: TButton;
Block1SpeedButton1: TSpeedButton;
Block1SpeedButton2: TSpeedButton;
Block1SpeedButton3: TSpeedButton;
Block1SpeedButton4: TSpeedButton;
Block1SpeedButton5: TSpeedButton;
Block1SpeedButton6: TSpeedButton;
Block1SpeedButton7: TSpeedButton;
Edit_srec: TEdit;
Block1Edit1_2: TEdit;
Label14: TLabel;
Timer1: TTimer;
OpenDialog1: TOpenDialog;
Button2: TButton;
Block1Edit4_2: TEdit;
Label15: TLabel;
GroupBox2: TGroupBox;
Block2Label1: TLabel;
Block2Label2: TLabel;
Block2Label3: TLabel;
Block2Label4: TLabel;
Block2SpeedButton1: TSpeedButton;
Block2SpeedButton2: TSpeedButton;
Block2SpeedButton3: TSpeedButton;
Block2SpeedButton4: TSpeedButton;
Block2SpeedButton5: TSpeedButton;
Block2SpeedButton6: TSpeedButton;
Block2SpeedButton7: TSpeedButton;
Label6: TLabel;
Block2Edit1_1: TEdit;
Block2Edit2: TEdit;
Block2Edit3: TEdit;
Block2Edit4_1: TEdit;
Block2Edit1_2: TEdit;
Block2Edit4_2: TEdit;
GroupBox3: TGroupBox;
Block3Label1: TLabel;
Block3Label2: TLabel;
Block3Label3: TLabel;
Block3Label4: TLabel;
Block3SpeedButton1: TSpeedButton;
Block3SpeedButton2: TSpeedButton;
Block3SpeedButton3: TSpeedButton;
Block3SpeedButton4: TSpeedButton;
Block3SpeedButton5: TSpeedButton;
Block3SpeedButton6: TSpeedButton;
Block3SpeedButton7: TSpeedButton;
Label7: TLabel;
Block3Edit1_1: TEdit;
Block3Edit2: TEdit;
Block3Edit3: TEdit;
Block3Edit4_1: TEdit;
Block3Edit1_2: TEdit;
Block3Edit4_2: TEdit;
GroupBox11: TGroupBox;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label8: TLabel;
Label9: TLabel;
Block1Button1: TButton;
Block2Button1: TButton;
Block3Button1: TButton;
RadioGroup4: TRadioGroup;
RadioGroup5: TRadioGroup;
GroupBox4: TGroupBox;
Block4Label1: TLabel;
Block4Label2: TLabel;
Block4Label3: TLabel;
Block4Label4: TLabel;
Block4SpeedButton1: TSpeedButton;
Block4SpeedButton2: TSpeedButton;
Block4SpeedButton3: TSpeedButton;
Block4SpeedButton4: TSpeedButton;
Block4SpeedButton5: TSpeedButton;
Block4SpeedButton6: TSpeedButton;
Block4SpeedButton7: TSpeedButton;
Label13: TLabel;
Block4Edit1_1: TEdit;
Block4Edit2: TEdit;
Block4Edit3: TEdit;
Block4Edit4_1: TEdit;
Block4Edit1_2: TEdit;
Block4Edit4_2: TEdit;
Block4Button1: TButton;
GroupBox5: TGroupBox;
Block5Label1: TLabel;
Block5Label2: TLabel;
Block5Label3: TLabel;
Block5Label4: TLabel;
Block5SpeedButton1: TSpeedButton;
Block5SpeedButton2: TSpeedButton;
Block5SpeedButton3: TSpeedButton;
Block5SpeedButton4: TSpeedButton;
block5SpeedButton5: TSpeedButton;
Block5SpeedButton6: TSpeedButton;
Block5SpeedButton7: TSpeedButton;
Label20: TLabel;
Block5Edit1_1: TEdit;
Block5Edit2: TEdit;
Block5Edit3: TEdit;
Block5Edit4_1: TEdit;
Block5Edit1_2: TEdit;
Block5Edit4_2: TEdit;
Block5Button1: TButton;
CheckBox1: TCheckBox;
TrayIcon2: TTrayIcon;
Button3: TButton;
CheckBox2: TCheckBox;
Timer2: TTimer;

// procedure inifile_update;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure TrayIcon2DblClick(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
procedure RadioGroup1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure RadioGroup2Click(Sender: TObject);
procedure RadioGroup3Click(Sender: TObject);
procedure Label4Click(Sender: TObject);
procedure Label5Click(Sender: TObject);
procedure FormActivate(Sender: TObject);
procedure Block1Button1Click(Sender: TObject);
procedure Block2Button1Click(Sender: TObject);
procedure Block3Button1Click(Sender: TObject);
procedure RadioGroup4Click(Sender: TObject);
procedure RadioGroup5Click(Sender: TObject);
procedure Block4Button1Click(Sender: TObject);
procedure Block5Button1Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer2Timer(Sender: TObject);
private
{ Private 宣言 }
public
{ Public 宣言 }
end;

var
Form1: TForm1;
GlPreIdol1 :integer;
GlPreIdol2 :Integer;
GlTimerInterval :Integer;
// 1.2.0.7 add
GlHiddenInterval :Integer;
// end
Dir,ReleaseNo : string;
implementation
//uses


{$R *.dfm}
// 自分のiniFile 更新




コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする

最近の仕事

2009-12-23 | 日常
最近どんな仕事をやっているの?と質問されるとちょっと困る。
この職場での年数もだいぶ経っているし、優秀な部下も配属されているので
できるだけルーチン仕事は振ってしまって、既往のマニュアルを書きながら
引継ぎをおこなっている(次が決まっているとかは無いんですけど)。
 まあ、なかなか重たい仕事も残っていて形式だけ伝えてもすぐに困るのが
見えているので、そうは簡単にいかないのだが。
(いったい、いつになることでしょうね)

 というものの、色々な意味で世の中が急変しておりまして、分析仕事は前
にも増して重たいのが入ってくるので、思えば結構広範な仕事をやっている。
R言語もボチボチ使い始めてます。コードでグラフがかけるのが強力だと
思う。コード量も少ないんだよね。実装が上手なんでしょうね。

 あとどちらかというと臨時の仕事なのだが、今、お店へ情報表示ができる
大型ディスプレィの導入をしていて、表示データの関係で、業者の方とやり
とりしている。デジタルサイネージという分野なんですけど、あんまし金融
機関が得意な業者の方で無いみたいで、思いを伝えるのが大変でした(業者
の方もそれなりに頑張ってもらったんだけど、感覚が合わないのはしんどい
んだよね。最低限の実装で見切りを付けてあとは自己解決、、、まあ、得意
分野なんですけど) 優秀部下さんのキャパもあるので、表舞台部分は担って
もらいながら、泥臭いインターフェース周りを実装している。

ということで、最新のデータを確定して古いデータをバックアップしてという
作業をEXCEL-VBAで実装するのを休み明けに実装しないといけない。

以下は、休み明け用の備忘録、、officeTANAKA さんのページは、ほんとに洗練されてます。

FileSystemObjectの解説(目次)
FileSystemObjectオブジェクトは、ドライブ・フォルダ・ファイルなどを操作できるオブジェクトです。
FileSystemObjectオブジェクトは、Scrrun.dllファイル内のスクリプティングタイプライブラリとして提供されます。
VBAからFileSystemObjectオブジェクトを利用するには、CreateObjectメソッドを実行してFileSystemObjectオブジェクト
のインスタンスを作成し、そのインスタンスに対してプロパティの設定やメソッドを実行します。


プロパティとメソッド

コメント
  • X
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする