diff --git a/.gitignore b/.gitignore index df09299..a45b93e 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ *.db *.opensdf + +.idea/ + +.vs/ diff --git a/TestSimulator/BlockAnd.cpp b/TestSimulator/BlockAnd.cpp index dad179c..f38758c 100644 --- a/TestSimulator/BlockAnd.cpp +++ b/TestSimulator/BlockAnd.cpp @@ -115,11 +115,17 @@ void CBlockAnd::SetBlkHead2Num (int iHeadBlkNum) double CBlockAnd::GetBlkValue () const { - //And邏輯 (若兩輸入皆為1,則回傳1,否則回傳0) - if (abs (m_pBlkHead1->GetBlkValue () - 1) < TOLERANCE && abs (m_pBlkHead2->GetBlkValue () - 1) < TOLERANCE) - return 1.; - else - return 0.; + if (m_pBlkHead1 != NULL && m_pBlkHead2 != NULL) + { + if (abs((int) (m_pBlkHead1->GetBlkValue () - 1)) < TOLERANCE && abs((int) (m_pBlkHead2->GetBlkValue () - 1)) < TOLERANCE) + { + return 1.; + } + else + { + return 0.; + } + } } int CBlockAnd::GetValueFlag () const diff --git a/TestSimulator/Initial.ini b/TestSimulator/Initial.ini index b93eb27..9e601a6 100644 --- a/TestSimulator/Initial.ini +++ b/TestSimulator/Initial.ini @@ -2,5 +2,5 @@ BgPicBOOL=FALSE BgPicPath=None BgColor=8454016 -GridBOOL=TRUE -LockBOOL=TRUE +GridBOOL=FALSE +LockBOOL=FALSE diff --git a/TestSimulator/TestSimulator.aps b/TestSimulator/TestSimulator.aps new file mode 100644 index 0000000..e9c5dac Binary files /dev/null and b/TestSimulator/TestSimulator.aps differ diff --git a/TestSimulator/TestSimulator.vcxproj b/TestSimulator/TestSimulator.vcxproj index 34ed872..6963e5a 100644 --- a/TestSimulator/TestSimulator.vcxproj +++ b/TestSimulator/TestSimulator.vcxproj @@ -14,15 +14,15 @@ {C1F3E95D-9580-4550-A748-674E1D31DF84} TestSimulator MFCProj - 8.1 + 10 Application true - v110 MultiByte Static + v143 Application @@ -56,6 +56,7 @@ Disabled WIN32;_WINDOWS;_DEBUG;%(PreprocessorDefinitions) true + stdcpp20 Windows