Beispiel #1
0
        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 = "簡略化完了";
        }
Beispiel #2
0
        private string genExp(KarnoughEngine eng, IKarnoughMap map)
        {
            IKarnoughLogic log = eng.getExp(map);

            return(log.genLogicExpression());
        }
Beispiel #3
0
 private IKarnoughMap genMap(KarnoughEngine eng, string exp)
 {
     return(eng.solve(exp));
 }