Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #include <windows.h>
- #include <fstream>
- #include <iostream>
- #include <string>
- #include <cstdlib>
- #pragma hdrstop
- using namespace std;
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- string current_value;
- ifstream NewFile;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::startButtonClick(TObject *Sender)
- {
- startDiode->Brush->Color = clGreen;
- //if(NewFile.is_open() == true)
- //{
- getline(NewFile, current_value);
- int current_position = atoi(current_value.c_str());
- indicator->Position = current_position;
- //}
- //else
- //{
- // Close();
- //}
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::stopButtonClick(TObject *Sender)
- {
- stopDiode->Brush->Color = clRed;
- startDiode->Brush->Color = clWhite;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::offButtonClick(TObject *Sender)
- {
- startDiode->Brush->Color = clWhite;
- stopDiode->Brush->Color = clWhite;
- NewFile.close();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::powerButtonClick(TObject *Sender)
- {
- char file_name [MAX_PATH];
- OpenTextFileDialog1->Execute();
- NewFile.open(file_name);
- }
- //---------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement