/// <summary> /// 置位位 /// </summary> /// <param name="ps"></param> public static void SetBit(this ITagOp tagOp, List <CCParameter> ps) { try { string tag = ps[0].DisplayValue; tagOp.WriteTag(tag, true); } catch (Exception ex) { Console.WriteLine("SetBit" + ex.ToString()); } }
public static void InvertBit(this ITagOp tagOp, string tag) { try { bool current = (bool)tagOp.ReadTag(tag); bool toggle = !current; tagOp.WriteTag(tag, toggle); } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }