public d1234(d1_pha p1_pha, d2_data p2_data, d4_tech p4_tech, d5_nsx p5_nsx) { v1_pha = p1_pha; v2_data = p2_data; v3_tech = p4_tech; v4_nsx = p5_nsx; }
public static d1234 f_data_type (string s_line_data, string factory_type) { s_line_data = s_line_data.Split(new String[] { "\t", " " }, StringSplitOptions.None)[0].Trim(); d1_pha v1_pha = 0; d2_data v2_data = 0; d4_tech v4_tech = 0; d5_nsx v5_nsx = 0; int k = 0; switch (s_line_data) { case "tsvh": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.TSVH; v4_tech = d4_tech.RF; break; case "tsvhvalue": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.TSVH; break; case "tstt": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.TSTT; v4_tech = d4_tech.RF; break; case "tstt_3pha???": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.TSTT; break; case "loadvalue_???": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.LOAD_PROFILE; v4_tech = d4_tech.RF; break; case "loadvalue": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.LOAD_PROFILE; break; case "load1dayvalue???": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.LOAD_PROFILE_DAY; v4_tech = d4_tech.RF; break; case "load1dayvalue": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.LOAD_PROFILE_DAY; break; case "even": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.EVEN; v4_tech = d4_tech.RF; break; case "eventvalue": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.EVEN; break; case "fday": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.FIX_DAY; v4_tech = d4_tech.RF; break; case "cscvalue": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.FIX_DAY; break; case "fmon": //1pha; v1_pha = d1_pha._1pha; v2_data = d2_data.FIX_MONTH; v4_tech = d4_tech.RF; break; case "fmon_3pha???": //3pha; v1_pha = d1_pha._3pha; v2_data = d2_data.FIX_MONTH; break; } if (v2_data == 0 && s_line_data.StartsWith("tsvh")) { // if PLC is 1 pha - fix day v1_pha = d1_pha._1pha; v2_data = d2_data.FIX_DAY; v4_tech = d4_tech.PLC; } if (v1_pha == d1_pha._1pha) { if (factory_type.Contains("psmart")) { v5_nsx = d5_nsx.PSMART; } else if (factory_type.Contains("vnsino")) { v5_nsx = d5_nsx.VNSINO; } else if (factory_type.Contains("omni")) { v5_nsx = d5_nsx.OMNI; } } return(new d1234(v1_pha, v2_data, v4_tech, v5_nsx)); }