MqttToSpeakStepFlow.prototype._SelectComPortSetting_ = function(that)
{
	var TopMenuId="Top-Menu-SystemSetting", LeftListId="Left-List-ComPortSetting";
	MqttToSpeakStepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	MqttToSpeakStepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};
MqttToSpeakStepFlow.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");
};
MqttToSpeakStepFlow.prototype._DisableElement_ = function(TopMenuId, LeftListId)
{
	MqttToSpeakStepFlow.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);
};

MqttToSpeakStepFlow.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");
};

MqttToSpeakStepFlow.prototype._UnlockAllModule_ = function(that)
{
	var TopMenuId="Top-Menu-ModuleSetting", LeftListId="Left-List-RTU";
	MqttToSpeakStepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	MqttToSpeakStepFlow.prototype._StopFingerIcon_();

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

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

	$("#Main_Top-Menu").find("#"+TopMenuId).css('opacity', 1);
};
MqttToSpeakStepFlow.prototype._SelectMqttCertificate_ = function(that)
{
	var TopMenuId="Top-Menu-File", LeftListId="Left-List-MqttCertificate";
	MqttToSpeakStepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	MqttToSpeakStepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};

MqttToSpeakStepFlow.prototype._SelectBrokerSetting_ = function(that)
{
	var TopMenuId="Top-Menu-IotPlatformSetting", LeftListId="Left-List-LocalBroker";
	MqttToSpeakStepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	MqttToSpeakStepFlow.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);
};

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

MqttToSpeakStepFlow.prototype._MqttToIoTCloud_ = function(that)
{
	var Class = new MqttToIoTCloudUpdatePage();
	var TopMenuId="Top-Menu-ConvertTransmission", LeftListId="Left-List-MqttToIoTCloud";
	MqttToSpeakStepFlow.prototype._ClickElement_(that, TopMenuId, LeftListId);
	MqttToSpeakStepFlow.prototype._DisableElement_(TopMenuId, LeftListId);
};



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

StepFlowMqttToIoTCloud.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");
				StepFlowMqttToIoTCloud.prototype._AllEnableElement_();
				$("#Main_Top-StepFlow").find(".StepTable").hide();
				$(that).closest('.Column').find(".Message").hide();
				clearInterval(SetInterval);
			},2500);
		}
		else
		{
			ssocket.emit('StartMainSystem');
		}
	});
};
StepFlowMqttToIoTCloud.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');
		}
	});
};
StepFlowMqttToIoTCloud.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);
};
















ModbusToOpcuaStepFlow.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToOpcuaStepFlow.prototype._SaveTcpToOpcua_ = function(that)
{
	var xotree = new XML.ObjTree();
	var OpcUaLocalServerXml = xotree.writeXML(Global_OpcUaLocalServer);

	var Result_1={"Input":null}, Result_2={"Input":null};

	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveOpcUaLocalServer", new Array(OpcUaLocalServerXml), Result_1);

	var Class_2 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_2);

	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToOpcuaStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToOpcuaStepFlow.prototype._SaveRtuToOpcua_ = function(that)
{
	var xotree = new XML.ObjTree();
	var OpcUaLocalServerXml = xotree.writeXML(Global_OpcUaLocalServer);

	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null};

	var Class_1 = new Transmission();
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_1);
	Class_1.TransmissionArray("SaveOpcUaLocalServer", new Array(OpcUaLocalServerXml), Result_2);

	var Class_2 = new RtuModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_3);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToOpcuaStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToOpcuaStepFlow.prototype._SaveAsciiToOpcua_ = function(that)
{
	var xotree = new XML.ObjTree();
	var OpcUaLocalServerXml = xotree.writeXML(Global_OpcUaLocalServer);

	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null};

	var Class_1 = new Transmission();
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_1);
	Class_1.TransmissionArray("SaveOpcUaLocalServer", new Array(OpcUaLocalServerXml), Result_2);

	var Class_2 = new AsciiModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_3);

	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToOpcuaStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToOpcuaStepFlow.prototype._SaveMqttToOpcua_ = function(that)
{
	var xotree = new XML.ObjTree();
	var OpcUaLocalServerXml = xotree.writeXML(Global_OpcUaLocalServer);

	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};

	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_1);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_2);
	Class_1.TransmissionArray("SaveOpcUaLocalServer", new Array(OpcUaLocalServerXml), Result_3);

	var Class_2 = new MqttModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_4);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToOpcuaStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};




















StepFlowMqttToIoTCloud.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMqttStepFlow.prototype._SaveTcpToMqtt_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_1);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_2);
	var Class_2 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_3);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMqttStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMqttStepFlow.prototype._SaveRtuToMqtt_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_1);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_2);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_3);
	var Class_2 = new RtuModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_4);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMqttStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMqttStepFlow.prototype._SaveAsciiToMqtt_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_1);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_2);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_3);
	var Class_2 = new AsciiModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_4);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMqttStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};




















ModbusToMqttJsonStepFlow.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMqttJsonStepFlow.prototype._SaveTcpToMqttJson_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null}, Result_5={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveAzurePlatformSetting", new Array(Global_AzurePlatform), Result_1);
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_2);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_3);
	Class_1.TransmissionString("SaveMqttJsonGroup", JSON.stringify(Global_MqttJsonGroup), Result_4);
	var Class_2 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_5);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true && Result_5["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMqttJsonStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMqttJsonStepFlow.prototype._SaveRtuToMqttJson_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Result_5={"Input":null}, Result_6={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveAzurePlatformSetting", new Array(Global_AzurePlatform), Result_1);
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_2);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_3);
	Class_1.TransmissionString("SaveMqttJsonGroup", JSON.stringify(Global_MqttJsonGroup), Result_4);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_5);
	var Class_2 = new RtuModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_6);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true && 
		   Result_5["Input"]==true && Result_6["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMqttJsonStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMqttJsonStepFlow.prototype._SaveAsciiToMqttJson_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Result_5={"Input":null}, Result_6={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveAzurePlatformSetting", new Array(Global_AzurePlatform), Result_1);
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_2);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_3);
	Class_1.TransmissionString("SaveMqttJsonGroup", JSON.stringify(Global_MqttJsonGroup), Result_4);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_5);
	var Class_2 = new AsciiModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_6);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true && 
		   Result_5["Input"]==true && Result_6["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMqttJsonStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};



















ModbusToMsSqlStepFlow.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMsSqlStepFlow.prototype._SaveTcpToMsSql_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionString("SaveMsSqlConnection", JSON.stringify(Global_MsSqlConnection), Result_1);
	var Class_2 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMsSqlStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMsSqlStepFlow.prototype._SaveRtuToMsSql_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionString("SaveMsSqlConnection", JSON.stringify(Global_MsSqlConnection), Result_1);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_2);
	var Class_2 = new RtuModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_3);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMsSqlStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMysqlConnectionStepFlow.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMysqlConnectionStepFlow.prototype._SaveTcpToMysqlConnection_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null};
	var Class_1 = new TcpModuleFirstPage();
	Class_1.SaveDataLayerAndServiceLayerVariables(Result_1);

	var Class_2 = new MysqlConnectionFirstPage();
	Class_2.SaveMysqlConnectionSetting(Result_2);

	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			ModbusToMysqlConnectionStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToMysqlConnectionStepFlow.prototype._SaveRtuToMysqlConnection_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null};
	
	var Class_1 = new RtuModuleFirstPage();
	Class_1.SaveDataLayerAndServiceLayerVariables(Result_1);
	var Class_2 = new MysqlConnectionFirstPage();
	Class_2.SaveMysqlConnectionSetting(Result_2);
	var Class_3 = new ComPortInterfaceSetting();
	Class_3.SaveComPortInterfaceSetting();

	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			Class_3 = null;  delete Class_3;
			ModbusToMysqlConnectionStepFlow.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};




















ModbusToPidOperationStepFlow.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToPidOperationStepFlow.prototype._SaveAsciiToPidOperation_ = function(that)
{
	var Result_1={"Input":null};
	var Class_1 = new AsciiModuleFirstPage();
	Class_1.SaveDataLayerAndServiceLayerVariables(Result_1);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true)
		{
			ModbusToPidOperationStepFlow.prototype._SaveXml_(that)
			Class_1 = null;  delete Class_1;
			clearInterval(SetInterval);
		}
	},500);
}

ModbusToPidOperationStepFlow.prototype._SaveAllToPidOperation_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionString("SavePidOperationVariable", JSON.stringify(Global_PidOperation), Result_1);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_2);
	var Class_2 = new RtuModuleFirstPage();
	var Class_3 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_3);
	Class_3.SaveDataLayerAndServiceLayerVariables(Result_4);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true)
		{
			ModbusToPidOperationStepFlow.prototype._SaveAsciiToPidOperation_(that);
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			Class_3 = null;  delete Class_3;
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToPidOperationStepFlow.prototype._SaveAllToPidOperationAndOpcua_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionString("SavePidOperationVariable", JSON.stringify(Global_PidOperation), Result_1);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_2);
	var Class_2 = new RtuModuleFirstPage();
	var Class_3 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_3);
	Class_3.SaveDataLayerAndServiceLayerVariables(Result_4);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true)
		{
			ModbusToPidOperationStepFlow.prototype._SaveAsciiToPidOperation_(that);
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			Class_3 = null;  delete Class_3;
			clearInterval(SetInterval);
		}
	},500);
};




















ModbusToIftttConditionTriggerStepFlow.prototype._SaveXml_ = function(that)
{
	var Class = new ControllerServiceSetting();
	var Result_1={"Input":null}, Result_2={"Input":null};
	Class.SaveDeviceDri(Result_1);
	Class.SaveServiceXml(Result_2);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true)
		{
			Class = null;  delete Class;
			$(that).closest('.Row').find(".BigLoading").hide();
			var StepFlowClass = new StepFlow();
			StepFlowClass.UnLockAllUi();
			clearInterval(SetInterval);
		}
	},500);
};

ModbusToIftttConditionTriggerStepFlow.prototype._SaveAsciiToIftttConditionTrigger_ = function(that)
{
	var Result_1={"Input":null};
	var Class_1 = new AsciiModuleFirstPage();
	Class_1.SaveDataLayerAndServiceLayerVariables(Result_1);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true)
		{
			ModbusToIftttConditionTriggerStepFlow.prototype._SaveXml_ (that);
			Class_1 = null;  delete Class_1;
			clearInterval(SetInterval);
		}
	},500);
}
ModbusToIftttConditionTriggerStepFlow.prototype._SaveAllToIftttConditionTrigger_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Result_5={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionString("SaveIftttConditionTriggerSetting", JSON.stringify(Global_IftttConditionTriggerSetting), Result_1);
	Class_1.TransmissionString("SaveIftttConditionTriggerVariable", JSON.stringify(Global_IftttConditionTriggerVariable), Result_2);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_3);
	var Class_2 = new RtuModuleFirstPage();
	var Class_3 = new TcpModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_4);
	Class_3.SaveDataLayerAndServiceLayerVariables(Result_5);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true &&
		   Result_5["Input"]==true)
		{
			ModbusToIftttConditionTriggerStepFlow.prototype._SaveAsciiToIftttConditionTrigger_(that);
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			Class_3 = null;  delete Class_3;
			clearInterval(SetInterval);
		}
	},500);
};

StepFlowMqttToIoTCloud.prototype._SaveMqttToIoTCloud_ = function(that)
{
	var Result_1={"Input":null}, Result_2={"Input":null}, Result_3={"Input":null}, Result_4={"Input":null};
	var Result_5={"Input":null}, Result_6={"Input":null}, Result_7={"Input":null};
	var Class_1 = new Transmission();
	Class_1.TransmissionArray("SaveAzurePlatformSetting", new Array(Global_AzurePlatform), Result_1);
	Class_1.TransmissionArray("SaveLocalBrokerSetting", Global_LocalBroker, Result_2);
	Class_1.TransmissionArray("SaveRemoteBrokerSetting", new Array(Global_RemoteBroker), Result_3);
	Class_1.TransmissionString("SaveRemoteMqttGroup", JSON.stringify(Global_RemoteMqttGroup), Result_4);
	Class_1.TransmissionString("SaveComPortSetting", JSON.stringify(Global_ComPort), Result_5);
	Class_1.TransmissionString("SaveMqttJsonGroup", JSON.stringify(Global_MqttJsonGroup), Result_6);
	var Class_2 = new RtuModuleFirstPage();
	Class_2.SaveDataLayerAndServiceLayerVariables(Result_7);
	var SetInterval = setInterval(function()
	{
		if(Result_1["Input"]==true && Result_2["Input"]==true && Result_3["Input"]==true && Result_4["Input"]==true && 
		   Result_5["Input"]==true && Result_6["Input"]==true && Result_7["Input"]==true)
		{
			Class_1 = null;  delete Class_1;
			Class_2 = null;  delete Class_2;
			StepFlowMqttToIoTCloud.prototype._SaveXml_(that);
			clearInterval(SetInterval);
		}
	},500);
};