// Place global declarations here.
chan pushRefund, pushedRefund, pushButton_BlackCoffee, pushButton_MilkCoffee, insertMoney_100, insertMoney_500, moneyView, buttonView, makeCoffeeViewON, makeCoffeeViewOFF, minusMoney;
int sumMoney, in_money, coffee_minusMoney;
int choiceButton = 0;
bool b_refund = true;
bool b_button;
bool b_money = true;
bool b_sumMoney = true;
bool b_makeCoffee;
bool b_mikeCoffeeButton, b_blackCoffeeButton;
MoneyBox// Place local declarations here.
int countMoney = 0;
bool refund_on = false;
void refundMoney()
{
sumMoney = 0;
}
void refundOverMoney(int t_money)
{
sumMoney = sumMoney - t_money;
}
void setAddMoney(int t_money)
{
sumMoney = sumMoney + t_money;
if(sumMoney > 5000)
{
refundOverMoney(t_money);
}
}
void setMinusMoney(int t_button)
{
sumMoney = sumMoney - t_button;
}REFUND_MONEYMoneyBoxIDLELedViewvoid setMoneyView()
{
b_sumMoney = true;
}
void setMakeCoffeeView(bool f)
{
b_makeCoffee = f;
}
void setButtonView()
{
if(sumMoney >= 200)
{
b_mikeCoffeeButton = true;
}
else
{
b_mikeCoffeeButton = false;
}
if(sumMoney >= 300)
{
b_blackCoffeeButton = true;
}
else
{
b_blackCoffeeButton = false;
}
}COFFEE_BTN_VIEWMAKE_COFFEE_VIEWIDLEUser
IDLEMachineclock time;
void makeCoffee(int t_button)
{
choiceButton = t_button;
}
void setPushedButton(int t_money)
{
coffee_minusMoney = t_money;
}
void setButtonView(bool b)
{
b_mikeCoffeeButton = b;
b_blackCoffeeButton = b;
}
void timeOver()
{
sumMoney = 0;
}
REFUND_COMPLETERESETACTION_WAITFINISHMAKE_COFFEECHOICE_COFFEEIDLE// Place template instantiations here.
// List one or more processes to be composed into a system.
system MoneyBox, LedView, User, Machine;