コード例 #1
0
        public Ferma(string _name, string filename)
        {
            name = _name;
            computer.Open();
            filenameSetting = filename;

            currentMiner = new Miner();

            listVideoCard = new List <VideoCard>();
            listCommand   = new List <Command>();
            listMessage   = new List <FermaMessage>();
            listMiner     = new List <Miner>();

            LoadXML(filename);

            modbusTCP = new ModbusTCP(this, this.IPaddrClient);

            CommandTemp comTemp = new CommandTemp("/temp", this);

            listCommand.Add(comTemp);

            CommandMaxTemp comMaxTemp = new CommandMaxTemp("/maxtemp", this);

            listCommand.Add(comMaxTemp);

            CommandCont comCont = new CommandCont("/vent", this);

            listCommand.Add(comCont);

            CommandStop comStop = new CommandStop("/stop", this);

            listCommand.Add(comStop);

            CommandMiner comZECMiner = new CommandMiner("/ZEC", this, "ZEC");

            listCommand.Add(comZECMiner);

            CommandMiner comZCLMiner = new CommandMiner("/ZCL", this, "ZCL");

            listCommand.Add(comZCLMiner);

            CommandMiner comVTCMiner = new CommandMiner("/VTC", this, "VTC");

            listCommand.Add(comVTCMiner);

            CommandMiner comBTGMiner = new CommandMiner("/BTG", this, "BTG");

            listCommand.Add(comBTGMiner);

            CommandMiner comMusicMiner = new CommandMiner("/Music", this, "Music");

            listCommand.Add(comMusicMiner);

            CommandMiner comETHMiner = new CommandMiner("/ETH", this, "ETH");

            listCommand.Add(comETHMiner);

            tcpClient = new TcpClient(this);

            getHardwareInformation = new Task(GetHardwareInformation);
            executeCommand         = new Task(ExecuteCommand);
            send = new Task(SendMessage);
        }