⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainprofile.pas.~448~

📁 自助公交信息短信服务平台
💻 ~448~
📖 第 1 页 / 共 2 页
字号:
          begin
              buslines[pts]:=s;
         Readln(f,s);
          inc(tempi);
         inc(pts);
         if pts=60 then
           pts:=62;
          end

        else
          if pts<70 then
          begin
           buslines[pts]:=s;
         Readln(f,s);
          inc(tempi);
         inc(pts);
         if pts=69 then
           pts:=70;
        end
              else
          if pts<106 then
          begin
          buslines[pts]:=s;
         Readln(f,s);
          inc(tempi);
         inc(pts);
         if pts=105 then
           pts:=106;
          end
          else
          if pts<126 then
          begin
           buslines[pts]:=s;
         Readln(f,s);
          inc(tempi);
         inc(pts);
         if pts=125 then
           pts:=127;
          end
           else
           if pts<130   then
           begin
            buslines[pts]:=s;
         Readln(f,s);
          inc(tempi);
         inc(pts);
         if pts=129 then
           pts:=201;
           end

          else
          //if pts>200 then
          begin
            buslines[pts]:=s;
         Readln(f,s);
          inc(tempi);
         inc(pts);
          end;

       // showmessage(buslines[pts-1]+'   '+inttostr(pts)+'  '+inttostr(tempi));
    end;
    //end another if for read bus herer
   end;
    // showmessage(buslines[24]+''+buslines[130]+''+buslines[68]+'   '+inttostr(pts));
  closefile(f);
end;
  {用于读取文件,一行行的初始化问题内容}



procedure TForm1.initstringgrid();
var i,j:integer;
              {ONLY FOR input valuse for the stringgrids and more}
begin
 { with StringGrid1 do
   begin
     For i:=0 to ColCount do
  For j:=0 to RowCount do
    if (i<>0) and (j<>0) then
       begin
         Cells[i,j]:=IntToStr(i)+'|'+IntToStr(j);
         end
       else
       begin
        
         end;
   end;
   }

end;



//
procedure TForm1.FormCreate(Sender:TObject);
var s1:string;
    tempi:integer;
begin
    tempi:=1;
     rowofgrid1:=1;
    rowofgrid2:=1;
     rowofgrid3:=1;
with StringGrid1 do
begin

Cells[0,0]:='电话号码';
Cells[1,0]:='      短信内容  ';
Cells[2,0]:='定时日期';
Cells[3,0]:='定时时间';
Cells[4,0]:='制作日期';
Cells[5,0]:='制作时间';
Cells[6,0]:='写信人';
Cells[7,0]:='处理状态';
s1:='sm2send.txt';
readfromfiles(s1);
end;
with StringGrid2 do
begin

Cells[0,0]:='电话号码';
Cells[1,0]:='  姓名 ';
Cells[2,0]:='电话组';
Cells[3,0]:='服务级别';
Cells[4,0]:='累计服务次数';
end;
with StringGrid3 do
begin

Cells[0,0]:='发信人号码';
Cells[1,0]:=' 姓名  ';
Cells[2,0]:='电话组';
Cells[3,0]:='短信内容';
Cells[4,0]:='格式';
Cells[5,0]:='收信日期';
Cells[6,0]:='收信时间';
Cells[7,0]:='处理标志';
end;
statusbar2.Panels[5].Text:=datetostr(date());
//getstringgrid1(s1,tempi);
//statusbar2.Panels[6].Text:=timetostr(time());
//init the buslines here
for tempi:=1 to 220 do
begin
    buslines[tempi]:=inttostr(tempi)+' 路尚未开通';

end;
//
  s1:='gj.txt';
readfromfiles(s1);
//
end;

procedure TForm1.SpeedButton1Click(Sender: TObject);
var
  res:integer;
begin

  initstringgrid;
  Label1.Caption := '正在启动....';
  Label1.Refresh;
  res := InfoDataComOpen;

  if res = 0 then
    begin
         ShowMessage('启动成功');
        Label1.Caption :='启动成功';
         Label1.Refresh;
        //启动线程
        TSendThread.Create(false);
       TWorkThread.Create(false);
    end
  else
   case res of
      1: begin
    showmessage('系统已经启动');
    Label1.Caption := '启动失败 原因 系统已经启动了';
    end;
    2..3:
    begin
    ShowMessage('启动失败:'+IntToStr(res)+'短信中心号码未定');
    Label1.Caption := '启动失败 原因 短信中心号码未定';
    end;
    4: begin
    showmessage('启动失败'+Inttostr(res)+'硬件错误' );
    Label1.Caption := '启动失败 原因 硬件错误';
    end;
    end;
    Label1.Refresh; 
end;

procedure TForm1.SpeedButton2Click(Sender: TObject);
var iclose:integer;     //for close the mc devices
begin
  {int  InfoDataComClose( )
返回值
0—关闭成功
}
iclose:=InfoDataComClose();
if(iclose<>0)    then
begin
showmessage('不能关闭');
end
else
begin
Label1.Caption:='关闭成功';
end;
end;

procedure TForm1.SpeedButton3Click(Sender: TObject);
begin       //直接关闭系统,先关闭硬件设备
    InfoDataComClose();
    Close();
end;

procedure TForm1.CheckBox1Click(Sender: TObject);
begin
CheckBox1.Enabled:=true;
ComboBox1.Enabled:=true;
 //此处加入日期和时间的选择
end;

procedure TForm1.Button1Click(Sender: TObject);
var            //发送到发件箱,具体的发送由线程来负责
res:integer;
tempi:integer;
begin
    
    If Length(Trim(memo1.Text))  <= 0 Then begin
        ShowMessage( '发送信息不能为空');
        Exit;
    end;
    if rowofgrid2 =1
    then begin
    showmessage('请添加发送对象');
    Exit;
    end;
   { Label1.Caption := '正在发送....';
    Label1.Refresh;
    str := Trim(EditMno.Text) + '|' + Trim(EditMsg.Text);
    res := InfoDataComSend(PChar(str));
    If res = 0 Then
        ShowMessage('发送成功')
    Else
        ShowMessage('失败:'+IntToStr(res));
    Label1.Caption := '';  }
   ////////////

    tempi:=1;
     while tempi<=rowofgrid2 do
     begin
     with stringgrid2 do
     begin
      setofstringgrid1[1]:= Cells[0,tempi];
      setofstringgrid1[2]:=Trim(memo1.Text);
      //3-6未定制日期和实际日期时间
      setofstringgrid1[3]:=datetostr(date());
       setofstringgrid1[4]:=datetostr(time());
       setofstringgrid1[5]:=datetostr(date());
       setofstringgrid1[6]:=datetostr(time());
     setofstringgrid1[7]:=Cells[1,tempi];
     setofstringgrid1[8]:='未处理';
     insertstringgrid1();
     tempi:=tempi+1;
     end;
     end;//end while
    {sendstr:='13869113249'+'|'+'this sm is form scsc smscenter ';
    res := InfoDataComSend(PChar(sendstr));
    If res = 0 Then
        ShowMessage('发送成功')
    Else
         //0 —发送成功
        //    -1—MC未启动
       //   -2—MC忙
       //   -3—发送失败

        ShowMessage('失败:'+IntToStr(res));
    Label1.Caption := '';  }


end;

procedure TForm1.Button11Click(Sender: TObject);
begin
{serarch for the spcial callcode's sm}
end;

procedure TForm1.Button6Click(Sender: TObject);
begin
{next sm of the special}
end;

procedure TForm1.Button7Click(Sender: TObject);
begin
{formor sm}
end;

procedure TForm1.Button8Click(Sender: TObject);
begin
{转发信息}
Form3.Memo1.Text:=Memo2.Text;
Form3.ShowModal;
end;

procedure TForm1.Button9Click(Sender: TObject);
begin
{回复 }
Form2.Edit1.Text:=Label5.Caption;
Form2.ShowModal;


end;

procedure TForm1.Button10Click(Sender: TObject);
begin
{delete currrent sm}
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
{insert customs}
Form4.ShowModal;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
{input group of callcode}
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
{delete the selected callcode}
end;

procedure TForm1.Button5Click(Sender: TObject);
var
i,j:integer;
begin
{free the client stringgrid}
 
with StringGrid2 do
 for i:=0 to ColCount-1 do
   for j:=0 to rowcount-1 do
   begin
     cells[i,j]:='';
end;
end;

procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
begin
 with   StringGrid1   do   
      begin
         // if   (ACol   <>   0)   and   (ARow   <>   0)   then
          begin
              if   ARow   mod   2   <>   0   then
                  Canvas.Brush.Color   :=   clYellow;
             // else
              //    Canvas.Brush.Color   :=   clGreen;
              Canvas.FillRect(Rect);
              Canvas.TextOut(Rect.Left   +   2,   Rect.Top   +   2,   Cells[ACol,   ARow]);
          end;


      end;

end;

procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
;{insert a client for the client grid}
end;

procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol, ARow: Integer;
  var CanSelect: Boolean);
  var memostr:string;
      callcode:string;
     

begin
with StringGrid1 do
begin
    if(ACol<>0)and(ARow<>0)then
    begin
        Canvas.Brush.Color:=clRed;
        memostr:=Cells[1,ARow];
        callcode:=Cells[0,ARow];
        memo1.Text:=memostr;
        StringGrid2.Cells[0,1]:=Trim(callcode);
    end;
end;
end;

procedure TForm1.StringGrid3SelectCell(Sender: TObject; ACol, ARow: Integer;
  var CanSelect: Boolean);
  var s:string;
  begin
   with Stringgrid3 do
     begin
    Edit2.Text:=Trim(Cells[0,ARow]);
    Edit3.Text:=Trim(Cells[1,ARow]);
    Edit4.Text:=Trim(Cells[2,ARow]);
    Edit5.Text:=Trim(Cells[4,ARow]);
    Edit6.Text:=Trim(Cells[5,ARow]);
    Edit7.Text:=Trim(Cells[6,ARow]);
    s:=Trim(Cells[7,ARow]);
    CheckBox2.Checked:=false;
    if(AnsiCompareText(s,'ok')=0)
    then
    CheckBox2.Checked:=true;
    Memo2.Text:=Trim(Cells[3,ARow]);
    end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -