StepFlow.prototype._TransmissionJson_ = function(ssocket, Command, string, Callback)
{
	var Length=20000, index=0;  var array = new Array("Start","");
	ssocket.emit(Command, array);	
	ssocket.on(Command, function (Return) {
		if(Return == "Start" || Return == "Send")
		{
			if(string.length > (index+Length)){
				array = new Array("Send", string.substring(index, index+Length));
			}
			else if(string.length <= (index+Length)){
				array = new Array("End", string.substring(index, string.length));
			}
			index = index + Length;
			ssocket.emit(Command, array);	
		}
		else if(Return == "End")
		{
			Callback();
		}
	});
};

StepFlow.prototype._SaveFinished_ = function(that, ssocket, Mode)
{
	ssocket.emit("SaveFinished");
	ssocket.on("SaveFinished", function (Return) {
		if(Return == true)
		{
			StepFlow.prototype._SaveXml_(Mode, that);
		}
		ssocket.emit("SocketClose");
	});
};
/*
StepFlow.prototype._SaveFinished_NoXml_ = function(that, ssocket)
{
	ssocket.emit("SaveFinished");
	ssocket.on("SaveFinished", function (Return) {
		if(Return == true)
		{
			$(that).closest('.Row').find(".Message").hide();
			$(that).closest('.Column').find(".Message").eq(0).show();
			var SetInterval = setInterval(function(){
				$("#Main_Top-FunctionWizard").find(".FunctionWizardTable").find(".Row").eq(0).find(".Select").val("null");
				StepFlow.prototype._AllEnableElement_();
				$("#Main_Top-StepFlow").find(".StepTable").hide();
				$(that).closest('.Column').find(".Message").hide();
				clearInterval(SetInterval);
			},2500);
		}
		ssocket.emit("SocketClose");
	});
};
*/
StepFlow.prototype._SaveStart_ = function(that, Mode)
{
	$(that).closest('.Row').find(".BigLoading").hide();
	var ssocket = io.connect();
	ssocket.emit("BackgroundExecution");
	ssocket.on("BackgroundExecution", function (Return) {
	if(Return == true)
	{
		StepFlow.prototype._SaveJson_(that, ssocket, Mode);
	}
	});
};

StepFlow.prototype._SaveJson_ = function(that, ssocket, Mode)
{
	if(Mode=="RtuToOpcua")                 {StepFlow.prototype._RtuToOpcua_(that, ssocket, Mode);}
	else if(Mode=="TcpToOpcua")            {StepFlow.prototype._TcpToOpcua_(that, ssocket, Mode);}
	else if(Mode=="AsciiToOpcua")          {StepFlow.prototype._AsciiToOpcua_(that, ssocket, Mode);}
	else if(Mode=="EipToOpcua")            {StepFlow.prototype._EipToOpcua_(that, ssocket, Mode);}
	else if(Mode=="MqttToOpcua")           {StepFlow.prototype._MqttToOpcua_(that, ssocket, Mode);}
	else if(Mode=="RtuToMqtt")             {StepFlow.prototype._RtuToMqtt_(that, ssocket, Mode);}
	else if(Mode=="TcpToMqtt")             {StepFlow.prototype._TcpToMqtt_(that, ssocket, Mode);}
	else if(Mode=="AsciiToMqtt")           {StepFlow.prototype._AsciiToMqtt_(that, ssocket, Mode);}
    else if(Mode=="EipToMqtt")             {StepFlow.prototype._EipToMqtt_(that, ssocket, Mode);}
	else if(Mode=="RtuToMqttJson")         {StepFlow.prototype._RtuToMqttJson_(that, ssocket, Mode);}
	else if(Mode=="TcpToMqttJson")         {StepFlow.prototype._TcpToMqttJson_(that, ssocket, Mode);}
	else if(Mode=="AsciiToMqttJson")       {StepFlow.prototype._AsciiToMqttJson_(that, ssocket, Mode);}
	else if(Mode=="PidOperation")          {StepFlow.prototype._PidOperation_(that, ssocket, Mode);}
	else if(Mode=="PidOperation + ToOpcua"){StepFlow.prototype._PidOperationToOpcua_(that, ssocket, Mode);}
	else if(Mode=="IftttConditionTrigger") {StepFlow.prototype._IftttConditionTrigger_(that, ssocket, Mode);}
	else if(Mode=="TcpToMsSql")   {StepFlow.prototype._TcpToMsSql_(that, ssocket, Mode);}
	else if(Mode=="RtuToMsSql")   {StepFlow.prototype._RtuToMsSql_(that, ssocket, Mode);}
};

StepFlow.prototype._SaveXml_ = function(Mode, that)
{
	if(Mode=="EipToOpcua" ||
	   Mode=="RtuToOpcua" || 
	   Mode=="TcpToOpcua" || 
	   Mode=="AsciiToOpcua"||
	   Mode=="MqttToOpcua")                 {StepFlow.prototype._ToOpcua_(that);}
	else if(Mode=="EipToMqtt" ||
			Mode=="RtuToMqtt" || 
			Mode=="TcpToMqtt" || 
			Mode=="AsciiToMqtt")            {StepFlow.prototype._ToMqtt_(that);}
	else if(Mode=="RtuToMqttJson" || 
			Mode=="TcpToMqttJson" || 
			Mode=="AsciiToMqttJson")        {StepFlow.prototype._ToMqtt_(that);}
	else if(Mode=="PidOperation")           {StepFlow.prototype._ToPidOperation_(that);}
	else if(Mode=="PidOperation + ToOpcua") {StepFlow.prototype._ToPidOperationAndOpcua_(that);}
	else if(Mode=="IftttConditionTrigger")  {StepFlow.prototype._ToAllModuleDriver_(that);}
	else if(Mode=="TcpToMsSql")    {StepFlow.prototype._ToAll_(that);}
	else if(Mode=="RtuToMsSql")    {StepFlow.prototype._ToAll_(that);}
};

StepFlow.prototype._ToOpcua_ = function(that)
{
	var ssocket = io.connect();
	var Callback0 = function(){ssocket.emit("SaveFinished");}

	var Class = new JsonTransformXml();
	var Xml_1 = Class.TransformVariableXml();
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveVariableTableXml", Xml_1, Callback0);}
	var Xml_2 = Class.TransformModbusDri();
	var Callback2 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveModbusDri", Xml_2, Callback1);}
	var Xml_3 = Class.TransformMqttDri();
	var Callback3 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveMqttDri", Xml_3, Callback2);}
	var Xml_4 = Class.TransformUAServerDataXml();
	StepFlow.prototype._TransmissionJson_(ssocket, "SaveUAServerDataXml", Xml_4, Callback3);

	ssocket.on("SaveFinished", function (Return)
	{
		ssocket.emit("SocketClose");
		$(that).closest('.Row').find(".BigLoading").hide();
	});
	Class=null;
};

StepFlow.prototype._ToMqtt_ = function(that)
{
	var ssocket = io.connect();
	var Callback0 = function(){ssocket.emit("SaveFinished");}
	
	var Class = new JsonTransformXml();
	var Xml_1 = Class.TransformVariableXml();
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveVariableTableXml", Xml_1, Callback0);}
	var Xml_2 = Class.TransformModbusDri();
	var Callback2 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveModbusDri", Xml_2, Callback1);}
	var Xml_3 = Class.TransformMqttServiceXml();
	StepFlow.prototype._TransmissionJson_(ssocket, "SaveMQTTServiceXml", Xml_3, Callback2);
	ssocket.on("SaveFinished", function (Return) 
	{
		ssocket.emit("SocketClose");
		$(that).closest('.Row').find(".BigLoading").hide();
	});
	Class=null;
};

StepFlow.prototype._ToPidOperation_ = function(that)
{
	var ClassCallback=new GetValue()
	var Send = new Transmission();
	var Class = new JsonTransformXml();
	var ssocket = io.connect();
	var Callback0 = function(){ssocket.emit("SaveFinished");}
	var Xml_1 = Class.TransformVariableXml();
	var Callback1 = function(){Send.TransmissionJson(ssocket, "SaveVariableTableXml", Xml_1, Callback0);}

	var Xml_2 = Class.TransformModbusDri();
	var Callback2 = function(){Send.TransmissionJson(ssocket, "SaveModbusDri", Xml_2, Callback1);}

	var Callback3 = ClassCallback.MethodTableXmlCallback(ssocket, Callback2);

	var Xml_4 = Class.TransformPidDriverDri();
	Send.TransmissionJson(ssocket, "SavePidDriverDri", Xml_4, Callback3);
	ssocket.on("SaveFinished", function (Return)
	{
		ssocket.emit("SocketClose");
		$(that).closest('.Row').find(".BigLoading").hide();
	});
	Class=null;
};

StepFlow.prototype._ToPidOperationAndOpcua_ = function(that)
{
	var ssocket = io.connect();
	var Callback0 = function(){ssocket.emit("SaveFinished");}
	
	var Class=new GetValue();
	var Callback1 = Class.VariableTableXmlCallback(ssocket, Callback0);
	var Callback2 = Class.ModbusDriCallback(ssocket, Callback1);
	var Callback3 = Class.PidDriverDriCallback(ssocket, Callback2);
	var Callback4 = Class.MethodTableXmlCallback(ssocket, Callback3);

	var Send = new Transmission();
	var ClassXml = new JsonTransformXml();
	var Xml = ClassXml.TransformUAServerDataXml();
	Send.TransmissionJson(ssocket, "SaveUAServerDataXml", Xml, Callback4);
	ssocket.on("SaveFinished", function (Return)
	{
		ssocket.emit("SocketClose");
		$(that).closest('.Row').find(".BigLoading").hide();
	});
	
	Class=null;
};

StepFlow.prototype._ToAllModuleDriver_ = function(that)
{
	var ssocket = io.connect();
	var Callback0 = function(){ssocket.emit("SaveFinished");}
	
	var Class=new GetValue();
	var Callback1 = Class.VariableTableXmlCallback(ssocket, Callback0);
	var Callback2 = Class.ModbusDriCallback(ssocket, Callback1);
	
	Class = new Transmission();
	var JsonString = JSON.stringify(Global_RtuIndex);
	Class.TransmissionJson(ssocket, "SaveRtuIndex", JsonString, Callback2);
	ssocket.on("SaveFinished", function (Return)
	{
		ssocket.emit("SocketClose");
		$(that).closest('.Row').find(".BigLoading").hide();
	});

	Class=null;
};

StepFlow.prototype._ToAll_ = function(that)
{
	var ssocket = io.connect();
	var Callback0 = function(){ssocket.emit("SaveFinished");}
	
	var Class=new GetValue();
	var Callback1 = Class.VariableTableXmlCallback(ssocket, Callback0);
	var Callback2 = Class.ModbusDriCallback(ssocket, Callback1);
	var Callback3 = Class.MqttDriCallback(ssocket, Callback2);
	var Callback4 = Class.UAServerDataXmlCallback(ssocket, Callback3);
	var Callback5 = Class.MqttServiceXmlCallback(ssocket, Callback4);
	var Callback6 = Class.MethodTableXmlCallback(ssocket, Callback5);
	Class = new JsonTransformXml();
	var Xml = Class.TransformPidDriverDri();
	Class = new Transmission();
	Class.TransmissionJson(ssocket, "SavePidDriverDri", Xml, Callback6);
	ssocket.on("SaveFinished", function (Return)
	{
		ssocket.emit("SocketClose");
		$(that).closest('.Row').find(".BigLoading").hide();
	});
	Class=null;
};

StepFlow.prototype._RtuToOpcua_ = function(that, ssocket, Mode)
{
	var xotree = new XML.ObjTree();
	var xml = xotree.writeXML(Global_OpcUaLocalServer);
	var array = new Array(xml);
	ssocket.emit("SaveOpcUaLocalServer", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}

	var JsonString0 = JSON.stringify(Global_RtuToOpcuaVariable);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveRtuToOpcuaVariable", JsonString0, Callback0);}

	var Callback2 = RtuModuleFirstPage.prototype._ComPortCallback_(ssocket, Callback1);
	var Callback3 = RtuModuleFirstPage.prototype._AsciiCallback_(ssocket, Callback2);
	var Callback4 = RtuModuleFirstPage.prototype._RtuCallback_(ssocket, Callback3);
	
	var JsonString1 = JSON.stringify(Global_RtuIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	var Class = new Transmission();
	Class.TransmissionJson(ssocket, "SaveRtuIndex", JsonString1, Callback4);
};

StepFlow.prototype._TcpToOpcua_ = function(that, ssocket, Mode)
{
	var xotree = new XML.ObjTree();
	var xml = xotree.writeXML(Global_OpcUaLocalServer);
	var array = new Array(xml);
	ssocket.emit("SaveOpcUaLocalServer", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}
	
	var JsonString0 = JSON.stringify(Global_TcpToOpcuaVariable);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveTcpToOpcuaVariable", JsonString0, Callback0);}

	var Callback2 = TcpModuleFirstPage.prototype._TcpCallback_(ssocket, Callback1);
	var JsonString1 = JSON.stringify(Global_TcpIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	var Class = new Transmission();
	Class.TransmissionJson(ssocket, "SaveTcpIndex", JsonString1, Callback2);
};

StepFlow.prototype._AsciiToOpcua_ = function(that, ssocket, Mode)
{
	var xotree = new XML.ObjTree();
	var xml = xotree.writeXML(Global_OpcUaLocalServer);
	var array = new Array(xml);
	ssocket.emit("SaveOpcUaLocalServer", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}
	
	var JsonString0 = JSON.stringify(Global_AsciiToOpcuaVariable);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveAsciiToOpcuaVariable", JsonString0, Callback0);}

	var Callback2 = AsciiModuleFirstPage.prototype._ComPortCallback_(ssocket, Callback1);
	var Callback3 = AsciiModuleFirstPage.prototype._RtuCallback_(ssocket, Callback2);
	var Callback4 = AsciiModuleFirstPage.prototype._AsciiCallback_(ssocket, Callback3);
	var JsonString1 = JSON.stringify(Global_AsciiIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	AsciiModuleFirstPage.prototype._TransmissionJson_(ssocket, "SaveAsciiIndex", JsonString1, Callback4);
};

StepFlow.prototype._MqttToOpcua_ = function(that, ssocket, Mode)
{
	var xotree = new XML.ObjTree();
	var xml = xotree.writeXML(Global_OpcUaLocalServer);
	var array = new Array(xml);
	ssocket.emit("SaveOpcUaLocalServer", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}
	
	var JsonString0 = JSON.stringify(Global_MqttToOpcuaVariable);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveMqttToOpcuaVariable", JsonString0, Callback0);}

	var Callback2 = MqttModuleFirstPage.prototype._MqttModuleCallback_(ssocket, Callback1);
	var JsonString1 = JSON.stringify(Global_MqttIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	MqttModuleFirstPage.prototype._TransmissionJson_(ssocket, "SaveMqttIndex", JsonString1, Callback2);
};

StepFlow.prototype._RtuToMqtt_ = function(that, ssocket, Mode)
{
	var array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}

	var JsonString1 = JSON.stringify(Global_RtuToMqttSetting);
	var Callback1 = function(){RtuToMqttFirstPage.prototype._TransmissionJson_(ssocket, "SaveRtuToMqttSetting", JsonString1, Callback0);}

	var JsonString2 = JSON.stringify(Global_RtuToMqttVariable);
	var Callback2 = function(){RtuToMqttFirstPage.prototype._TransmissionJson_(ssocket, "SaveRtuToMqttVariable", JsonString2, Callback1);}

	var Callback3 = RtuModuleFirstPage.prototype._ComPortCallback_(ssocket, Callback2);
	var Callback4 = RtuModuleFirstPage.prototype._AsciiCallback_(ssocket, Callback3);
	var Callback5 = RtuModuleFirstPage.prototype._RtuCallback_(ssocket, Callback4);

	var JsonString3 = JSON.stringify(Global_RtuIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	var Class = new Transmission();
	Class.TransmissionJson(ssocket, "SaveRtuIndex", JsonString3, Callback5);
};

StepFlow.prototype._TcpToMqtt_ = function(that, ssocket, Mode)
{
	var array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}
	
	var JsonString1 = JSON.stringify(Global_TcpToMqttSetting);
	var Callback1 = function(){TcpToMqttFirstPage.prototype._TransmissionJson_(ssocket, "SaveTcpToMqttSetting", JsonString1, Callback0);}
	var JsonString2 = JSON.stringify(Global_TcpToMqttVariable);
	var Callback2 = function(){TcpToMqttFirstPage.prototype._TransmissionJson_(ssocket, "SaveTcpToMqttVariable", JsonString2, Callback1);}
	
	var Callback3 = TcpModuleFirstPage.prototype._TcpCallback_(ssocket, Callback2);
	var JsonString3 = JSON.stringify(Global_TcpIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	var Class = new Transmission();
	Class.TransmissionJson(ssocket, "SaveTcpIndex", JsonString3, Callback3);
};

StepFlow.prototype._AsciiToMqtt_ = function(that, ssocket, Mode)
{
	var array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);
	
	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}
	
	var JsonString1 = JSON.stringify(Global_AsciiToMqttSetting);
	var Callback1 = function(){AsciiToMqttFirstPage.prototype._TransmissionJson_(ssocket, "SaveAsciiToMqttSetting", JsonString1, Callback0);}
	
	var JsonString2 = JSON.stringify(Global_AsciiToMqttVariable);
	var Callback2 = function(){AsciiToMqttFirstPage.prototype._TransmissionJson_(ssocket, "SaveAsciiToMqttVariable", JsonString2, Callback1);}
	
	var Callback3 = AsciiModuleFirstPage.prototype._ComPortCallback_(ssocket, Callback2);
	var Callback4 = AsciiModuleFirstPage.prototype._RtuCallback_(ssocket, Callback3);
	var Callback5 = AsciiModuleFirstPage.prototype._AsciiCallback_(ssocket, Callback4);
	var JsonString3 = JSON.stringify(Global_AsciiIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	AsciiModuleFirstPage.prototype._TransmissionJson_(ssocket, "SaveAsciiIndex", JsonString3, Callback5);
};

StepFlow.prototype._RtuToMqttJson_ = function(that, ssocket, Mode)
{
	var array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);

	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}

	var JsonString1 = JSON.stringify(Global_MqttJsonGroup);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveMqttJsonGroup", JsonString1, Callback0);}

	var JsonString2 = JSON.stringify(Global_RtuToMqttJsonVariable);
	var Callback2 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveRtuToMqttJsonVariable", JsonString2, Callback1);}

	var Callback3 = RtuModuleFirstPage.prototype._ComPortCallback_(ssocket, Callback2);
	var Callback4 = RtuModuleFirstPage.prototype._AsciiCallback_(ssocket, Callback3);
	var Callback5 = RtuModuleFirstPage.prototype._RtuCallback_(ssocket, Callback4);

	var JsonString3 = JSON.stringify(Global_RtuIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	var Class = new Transmission();
	Class.TransmissionJson(ssocket, "SaveRtuIndex", JsonString3, Callback5);
};

StepFlow.prototype._TcpToMqttJson_ = function(that, ssocket, Mode)
{
	var array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);

	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}

	var JsonString1 = JSON.stringify(Global_MqttJsonGroup);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveMqttJsonGroup", JsonString1, Callback0);}

	var JsonString2 = JSON.stringify(Global_TcpToMqttJsonVariable);
	var Callback2 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveTcpToMqttJsonVariable", JsonString2, Callback1);}

	var Callback3 = TcpModuleFirstPage.prototype._TcpCallback_(ssocket, Callback2);
	var JsonString3 = JSON.stringify(Global_TcpIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	var Class = new Transmission();
	Class.TransmissionJson(ssocket, "SaveTcpIndex", JsonString3, Callback3);
};

StepFlow.prototype._AsciiToMqttJson_ = function(that, ssocket, Mode)
{
	var array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);

	var Callback0 = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode);}

	var JsonString1 = JSON.stringify(Global_MqttJsonGroup);
	var Callback1 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveMqttJsonGroup", JsonString1, Callback0);}

	var JsonString2 = JSON.stringify(Global_AsciiToMqttJsonVariable);
	var Callback2 = function(){StepFlow.prototype._TransmissionJson_(ssocket, "SaveAsciiToMqttJsonVariable", JsonString2, Callback1);}

	var Callback3 = AsciiModuleFirstPage.prototype._ComPortCallback_(ssocket, Callback2);
	var Callback4 = AsciiModuleFirstPage.prototype._AsciiCallback_(ssocket, Callback3);
	var Callback5 = AsciiModuleFirstPage.prototype._RtuCallback_(ssocket, Callback4);
	var JsonString3 = JSON.stringify(Global_AsciiIndex);
	$(that).closest('.Row').find(".BigLoading").show();
	AsciiModuleFirstPage.prototype._TransmissionJson_(ssocket, "SaveAsciiIndex", JsonString3, Callback5);
};

StepFlow.prototype._PidOperation_ = function(that, ssocket, Mode)
{
	var array = Global_LocalBroker;
	ssocket.emit("SaveLocalBrokerSetting", array);
	array = new Array(Global_RemoteBroker);
	ssocket.emit("SaveRemoteBrokerSetting", array);

	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.ComPortCallback(ssocket, Callback);
	var Callback2=Class.RtuModuleCallback(ssocket, Callback1);
	var Callback3=Class.TcpModuleCallback(ssocket, Callback2);
	var Callback4=Class.AsciiModuleCallback(ssocket, Callback3);
	
	Class=new Transmission();
	var JsonString = JSON.stringify(Global_PidOperation);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SavePidOperationVariable", JsonString, Callback4);
};

StepFlow.prototype._PidOperationToOpcua_ = function(that, ssocket, Mode)
{
	var Class=new Transmission();
	Class.SaveOpcUaLocalServer();
	Class.SaveLocalBrokerSetting();
	Class.SaveRemoteBrokerSetting();

	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.ComPortCallback(ssocket, Callback);
	var Callback2=Class.RtuModuleCallback(ssocket, Callback1);
	var Callback3=Class.TcpModuleCallback(ssocket, Callback2);
	var Callback4=Class.AsciiModuleCallback(ssocket, Callback3);
	var Callback5=Class.AllModuleToOpcuaCallback(ssocket, Callback4);
	Class=new Transmission();
	var JsonString = JSON.stringify(Global_PidOperation);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SavePidOperationVariable", JsonString, Callback5);
};

StepFlow.prototype._IftttConditionTrigger_ = function(that, ssocket, Mode)
{
	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.ComPortCallback(ssocket, Callback);
	var Callback2=Class.RtuModuleCallback(ssocket, Callback1);
	var Callback3=Class.TcpModuleCallback(ssocket, Callback2);
	var Callback4=Class.AsciiModuleCallback(ssocket, Callback3);

	Class=new Transmission();
	var JsonString1 = JSON.stringify(Global_IftttConditionTriggerSetting);
	var Callback5=function(){Class.TransmissionJson(ssocket, "SaveIftttConditionTriggerSetting", JsonString1, Callback4);}

	var JsonString2 = JSON.stringify(Global_IftttConditionTriggerVariable);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SaveIftttConditionTriggerVariable", JsonString2, Callback5);
};

StepFlow.prototype._TcpToMsSql_ = function(that, ssocket, Mode)
{
	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.TcpModuleCallback(ssocket, Callback);
	var Callback2=Class.TcpToMsSqlVariableCallback(ssocket, Callback1);

	Class=new Transmission();
	var JsonString1 = JSON.stringify(Global_MsSqlConnection);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SaveMsSqlConnection", JsonString1, Callback2);
};

StepFlow.prototype._RtuToMsSql_ = function(that, ssocket, Mode)
{
	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.RtuModuleCallback(ssocket, Callback);
	var Callback2=Class.RtuToMsSqlVariableCallback(ssocket, Callback1);

	Class=new Transmission();
	var JsonString1 = JSON.stringify(Global_MsSqlConnection);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SaveMsSqlConnection", JsonString1, Callback2);
};

StepFlow.prototype._TcpToMysqlConnection_ = function(that, ssocket, Mode)
{
	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.TcpModuleCallback(ssocket, Callback);
	var Callback2=Class.TcpToMysqlConnectionVariableCallback(ssocket, Callback1);

	Class=new Transmission();
	var JsonString1 = JSON.stringify(Global_MysqlConnection);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SaveMysqlConnection", JsonString1, Callback2);
};

StepFlow.prototype._RtuToMysqlConnection_ = function(that, ssocket, Mode)
{
	var Callback = function(){StepFlow.prototype._SaveFinished_(that, ssocket, Mode)};
	var Class=new GetValue();
	var Callback1=Class.RtuModuleCallback(ssocket, Callback);
	var Callback2=Class.RtuToMysqlConnectionVariableCallback(ssocket, Callback1);

	Class=new Transmission();
	var JsonString1 = JSON.stringify(Global_MysqlConnection);
	$(that).closest('.Row').find(".BigLoading").show();
	Class.TransmissionJson(ssocket, "SaveMysqlConnection", JsonString1, Callback2);
};

StepFlow.prototype._AllEnableElement_ = function()
{
	$("#Main_Top-Path").find("div").css('pointer-events', "visible");
	$("#Main_Top-Path").find("div").css('opacity', 1);
	
	$("#Main_Top-Menu").find("div").css('pointer-events', "visible");
	$("#Main_Top-Menu").find("div").css('opacity', 1);
	
	$("#Main_Left-List").find("div").css('pointer-events', "visible");
	$("#Main_Left-List").find("div").css('opacity', 1);
};

StepFlow.prototype._ClickElement_ = function(that, TopMenuId, LeftListId)
{
	$("#Main_Top-Menu").find("#"+TopMenuId).click();
	$("#Main_Left-List").find("div").css('pointer-events', "none");
	$("#Main_Left-List").find("#"+LeftListId).click();
	StepFlow.prototype._ChangeDivCss_(that);
	$("#Main_Top-Path").find("div").css('pointer-events', "visible");
	$("#Main_Top-Menu").find("div").css('pointer-events', "visible");
	$("#Main_Left-List").find("div").css('pointer-events', "visible");
};

StepFlow.prototype._DisableElement_ = function(TopMenuId, LeftListId)
{
	StepFlow.prototype._StopFingerIcon_();
	$("#Main_Top-Path").find("div").css('pointer-events', "none");
	$("#Main_Top-Path").find("div").css('opacity', 0.5);

	$("#Main_Top-Menu").find("div").css('pointer-events', "none");
	$("#Main_Top-Menu").find("div").css('opacity', 0.5);

	$("#Main_Left-List").find("div").css('pointer-events', "none");
	$("#Main_Left-List").find("div").css('opacity', 0.5);

	$("#Main_Top-Menu").find("#"+TopMenuId).css('opacity', 1);
	$("#Main_Left-List").find("#"+LeftListId).css('opacity', 1);
};

StepFlow.prototype._ShowStepFlowRow_ = function(Index)
{
	if(Index == "null"){
		$("#Main_Top-StepFlow").find(".StepTable").hide();
		StepFlow.prototype._AllEnableElement_();
	}
	else{
		$("#Main_Top-StepFlow").find(".StepTable").find(".Row").hide();
		$("#Main_Top-StepFlow").find(".StepTable").find(".Row").eq(Index).show();
		$("#Main_Top-StepFlow").find(".StepTable").show();
		$("#Main_Top-StepFlow").find(".StepTable").find(".Row").eq(Index).find(".StepText").eq(0).click();
	}
};

StepFlow.prototype._ChangeDivCss_ = function(that)
{
	var LeftDivId="#Main_Left-Step", TopDivId="#Main_Top-StepFlow";
	var Class = new StepCommon();
	Class.ChangeDivCss(that, TopDivId);
	Class = null;
};

StepFlow.prototype._RunProject_ = function(that)
{
	$(that).closest('.Column').find(".Message").eq(1).show();
	StepFlow.prototype._RunMainProgram_(that);
	StepFlow.prototype._RunMqttBroker_();
};

StepFlow.prototype._RunProjectNoHide_ = function(that)
{
	$(that).closest('.Column').find(".Message").eq(1).show();
	StepFlow.prototype._RunMainProgramNoHide_(that);
};

StepFlow.prototype._RunProject_BackstageService_ = function(that)
{
	$(that).closest('.Column').find(".Message").eq(1).show();
	var Result_1={"Input":null};  var Result_2={"Input":null};
	var Class = new Transmission();
	Class.TransmissionArray("StartMainSystem", new Array(), Result_1);
	var SetInterval_1 = setInterval(function(){
		if(Result_1["Input"] == true){
			clearInterval(SetInterval_1);
			Class.TransmissionArray("StartBackstageService", new Array(), Result_2);
		}
	},500);
	var SetInterval_2 = setInterval(function(){
		if(Result_2["Input"] == true)
		{
			clearInterval(SetInterval_2);
			$(that).closest('.Column').find(".Message").hide();
			$(that).closest('.Column').find(".Message").eq(0).show();
			setTimeout(function()
			{
				$("#Main_Top-FunctionWizard").find(".FunctionWizardTable").find(".Row").eq(0).find(".Select").val("null");
				StepFlow.prototype._AllEnableElement_();
				$("#Main_Top-StepFlow").find(".StepTable").hide();
				$(that).closest('.Column').find(".Message").hide();
			}, 2000);
		}
	},500);
};

StepFlow.prototype._RunMainProgram_ = function(that)
{
	var ssocket = io.connect();
	ssocket.emit('StartMainSystem');
	ssocket.on('StartMainSystem', function (Return) {
		if(Return == true)
		{
			ssocket.emit("SocketClose");
			$(that).closest('.Column').find(".Message").hide();
			$(that).closest('.Column').find(".Message").eq(0).show();
			var SetInterval = setInterval(function()
			{
				$("#Main_Top-FunctionWizard").find(".FunctionWizardTable").find(".Row").eq(0).find(".Select").val("null");
				StepFlow.prototype._AllEnableElement_();
				$("#Main_Top-StepFlow").find(".StepTable").hide();
				$(that).closest('.Column').find(".Message").hide();
				clearInterval(SetInterval);
			},2500);
		}
		else
		{
			ssocket.emit('StartMainSystem');
		}
	});
};

StepFlow.prototype._RunMainProgramNoHide_ = function(that)
{
	var ssocket = io.connect();
	ssocket.emit('StartMainSystem');
	ssocket.on('StartMainSystem', function (Return) {
		if(Return == true)
		{
			ssocket.emit("SocketClose");
			$(that).closest('.Column').find(".Message").hide();
			$(that).closest('.Column').find(".Message").eq(0).show();
			var SetInterval = setInterval(function()
			{
				$(that).closest('.Column').find(".Message").hide();
				clearInterval(SetInterval);
			},2500);
		}
		else
		{
			ssocket.emit('StartMainSystem');
		}
	});
};

StepFlow.prototype._RunMqttBroker_ = function()
{
	var ssocket = io.connect();
	ssocket.emit('StartMqttBroker');
	ssocket.on('StartMqttBroker', function (Return) 
	{
		if(Return == true)
		{
			ssocket.emit("SocketClose");
		}
		else
		{
			ssocket.emit('StartMqttBroker');
		}
	});
};

StepFlow.prototype._SelectComPortSetting_ = function(that)
{
	var TopMenuId="Top-Menu-SystemSetting", LeftListId="Left-List-ComPortSetting";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._StartFingerIcon_ = function()
{
	var Column = $("#Main_Top-FunctionWizard").find(".FunctionWizardTable").find(".Row").find(".Column");
	Column.eq(1).show();
	Global_SetInterval = setInterval(function(){
		if(Column.eq(2).find(".Select").css("border-color") == "rgb(255, 0, 0)"){
			Column.eq(2).find(".Select").css("border-color", "rgb(170, 170, 170)");
		}
		else{
			Column.eq(2).find(".Select").css("border-color", "rgb(255, 0, 0)");
		}
		Column.eq(1).find("img").hide(400);
		Column.eq(1).find("img").show(400);
	}, 1000);
};

StepFlow.prototype._StopFingerIcon_ = function()
{
	clearInterval(Global_SetInterval);
	var Column = $("#Main_Top-FunctionWizard").find(".FunctionWizardTable").find(".Row").find(".Column");
	Column.eq(1).hide();
	Column.eq(2).find(".Select").css("border-color", "#AAAAAA");
	Column.eq(2).find(".Select").css("border-width", "1px");
};

StepFlow.prototype._SelectBrokerSetting_ = function(that)
{
	var TopMenuId="Top-Menu-IotPlatformSetting", LeftListId="Left-List-LocalBroker";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
	$("#Main_Left-List").find("#Left-List-LocalBroker").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-LocalBroker").css('opacity', 1);
	$("#Main_Left-List").find("#Left-List-RemoteBroker").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-RemoteBroker").css('opacity', 1);
};

StepFlow.prototype._SelectMqttGroupConnection_ = function(that)
{
	var TopMenuId="Top-Menu-IotPlatformSetting", LeftListId="Left-List-MqttJsonGroup";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectAzureSetting_ = function(that)
{
	var TopMenuId="Top-Menu-IotPlatformSetting", LeftListId="Left-List-AzurePlatform";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectOpcUaLocalServer_ = function(that)
{
	var TopMenuId="Top-Menu-IotPlatformSetting", LeftListId="Left-List-LocalServer";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterRtuToOpcua_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-RtuToOpcua";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterTcpToOpcua_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-TcpToOpcua";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterAsciiToOpcua_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-AsciiToOpcua";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectMqttToOpcua_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-MqttToOpcua";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._AllModuleToOpcua_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-RtuToOpcua";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
	var Div=$('#Main_Left-List').find("div");
	$('#Left-List-RtuToOpcua').css('pointer-events', "visible");
	$('#Left-List-TcpToOpcua').css('pointer-events', "visible");
	$('#Left-List-AsciiToOpcua').css('pointer-events', "visible");
	$('#Left-List-RtuToOpcua').css('opacity', 1);
	$('#Left-List-TcpToOpcua').css('opacity', 1);
	$('#Left-List-AsciiToOpcua').css('opacity', 1);
};

StepFlow.prototype._MasterRtuToMqtt_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-RtuToMqtt";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterTcpToMqtt_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-TcpToMqtt";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterAsciiToMqtt_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-AsciiToMqtt";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterRtuToMqttJson_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-RtuToMqttJson";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterTcpToMqttJson_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-TcpToMqttJson";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterAsciiToMqttJson_ = function(that)
{
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-AsciiToMqttJson";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};



StepFlow.prototype._MasterRtuModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-RTU";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterTcpModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-TCP";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MasterAsciiModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-ASCII";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._MqttModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-MQTT";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._AllModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-RTU";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
	$("#Main_Left-List").find(".Left-List").css('pointer-events', "visible");
	$("#Main_Left-List").find(".Left-List").css('opacity', 1);
};

StepFlow.prototype._MasterModbusModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-RTU";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._StopFingerIcon_();
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
	$("#Main_Left-List").find("#Left-List-RTU").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-RTU").css('opacity', 1);
	$("#Main_Left-List").find("#Left-List-TCP").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-TCP").css('opacity', 1);
	$("#Main_Left-List").find("#Left-List-ASCII").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-ASCII").css('opacity', 1);
};
StepFlow.prototype._UnlockAllModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-RTU";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._StopFingerIcon_();
	//StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
	/*$("#Main_Left-List").find("#Left-List-RTU").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-RTU").css('opacity', 1);
	$("#Main_Left-List").find("#Left-List-TCP").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-TCP").css('opacity', 1);
	$("#Main_Left-List").find("#Left-List-ASCII").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-ASCII").css('opacity', 1);*/
	$("#Main_Left-List").find("#Left-List-MqttToIoTCloud").css('pointer-events', "visible");
	$("#Main_Left-List").find("#Left-List-MqttToIoTCloud").css('opacity', 1);
};


StepFlow.prototype._SelectPidOperation_ = function(that)
{
	var TopMenuId="Top-Menu-AdvancedSetting", LeftListId="Left-List-PID";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectIftttConditionTrigger_ = function(that)
{
	var TopMenuId="Top-Menu-AdvancedSetting", LeftListId="Left-List-IftttConditionTrigger";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};







StepFlow.prototype._SelectMsSqlConnection_ = function(that)
{
	var TopMenuId="Top-Menu-AdvancedSetting", LeftListId="Left-List-MsSqlConnection";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectRtuModuleRecord_ = function(that)
{
	var TopMenuId="Top-Menu-LoggerSetting", LeftListId="Left-List-RtuToMsSql";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectTcpModuleRecord_ = function(that)
{
	var TopMenuId="Top-Menu-LoggerSetting", LeftListId="Left-List-TcpToMsSql";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectMysqlConnection_ = function(that)
{
	var TopMenuId="Top-Menu-AdvancedSetting", LeftListId="Left-List-MysqlConnection";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectRtuToMysqlConnection_ = function(that)
{
	var TopMenuId="Top-Menu-LoggerSetting", LeftListId="Left-List-RtuToMysqlConnection";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectTcpToMysqlConnection_ = function(that)
{
	var TopMenuId="Top-Menu-LoggerSetting", LeftListId="Left-List-TcpToMysqlConnection";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectMqttToMysql_ = function(that)
{
	var TopMenuId="Top-Menu-LoggerSetting", LeftListId="Left-List-MqttToMysql";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectMqttToMsSql_ = function(that)
{
	var TopMenuId="Top-Menu-LoggerSetting", LeftListId="Left-List-MqttToMsSql";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectIoStatus_ = function(that)
{
	var TopMenuId="Top-Menu-IoStatus", LeftListId;
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
	$("#Main_Left-List").find("div").css('pointer-events', "visible");
	$("#Main_Left-List").find("div").css('opacity', 1);
	$("#Main_Top-FunctionWizard").find(".FunctionWizardTable").find(".Row").eq(0).find(".Select").val("null");
	StepFlow.prototype._AllEnableElement_();
	$("#Main_Top-StepFlow").find(".StepTable").hide();
};

StepFlow.prototype._SelectOpcuaCertificate_ = function(that)
{
	var TopMenuId="Top-Menu-File", LeftListId="Left-List-OpcuaCertificate";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._SelectMqttCertificate_ = function(that)
{
	var TopMenuId="Top-Menu-File", LeftListId="Left-List-MqttCertificate";
	StepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	StepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

StepFlow.prototype._LockAllUi_ = function()
{
	$("#Main_Top-StepFlow").find("div").css('pointer-events', "none");
	if($("#Main_Top-StepFlow").find(".Row").is(":visible") == false)
	{
		$("#Main_Top-Menu").find("div").css('pointer-events', "none");
		$("#Main_Left-List").find("div").css('pointer-events', "none");
		$("#Main_Top-Path").find("div").css('pointer-events', "none");
	}
};

StepFlow.prototype._UnLockAllUi_ = function()
{
	$("#Main_Top-StepFlow").find("div").css('pointer-events', "visible");
	if($("#Main_Top-StepFlow").find(".Row").is(":visible") == false)
	{
		$("#Main_Top-Menu").find("div").css('pointer-events', "visible");
		$("#Main_Left-List").find("div").css('pointer-events', "visible");
		$("#Main_Top-Path").find("div").css('pointer-events', "visible");
	}
};