private async void RunButton_Click(object sender, EventArgs e) { if (File.Exists(PythonPathBox.Text) == false) { MessageBox.Show("指定したPython実行環境が存在しません。", "Pythonエラー"); return; } statusLabel.Text = "簡略化中"; KarnoughEngine eng = new KarnoughEngine(); eng.python_env = PythonPathBox.Text; eng.script = @"write_json.py"; IKarnoughMap map = await Task.Run(() => genMap(eng, LogicTexBox.Text)); string exp = genExp(eng, map); afterExpBox.Text = exp; karnaughCnt.testDraw(map); statusLabel.Text = "簡略化完了"; }
private string genExp(KarnoughEngine eng, IKarnoughMap map) { IKarnoughLogic log = eng.getExp(map); return(log.genLogicExpression()); }
private IKarnoughMap genMap(KarnoughEngine eng, string exp) { return(eng.solve(exp)); }