/// <summary> /// C#-oriented-method: Write an Event to the logger. Exposes all parameters in a way that should make /// it very easy to use the logging behaviour from C#. /// </summary> /// <param name="logger"></param> /// <param name="level"></param> /// <param name="template"> /// This is the message that you want to log. /// It's worth noting that a message without string.Format-ed parameters, is more equal /// across time, and if you have custom data you want to pass, you should rather set /// that data on the 'data' property of Message (with SetField and SetContext*).</param> /// <param name="setterTransformer"> /// There are extension methods in this library that go towards creating new instances /// of Message that you can use to change the value inside this function. /// </param> public static void LogEvent( this Logger logger, LogLevel level, string template, Func <Message, Message> setterTransformer) { if (logger == null) { throw new ArgumentNullException("logger"); } if (level == null) { throw new ArgumentNullException("level"); } if (template == null) { throw new ArgumentNullException("template"); } if (setterTransformer == null) { throw new ArgumentNullException("setterTransformer"); } var message = MessageModule.Event(level, template); var messageNext = setterTransformer(message); logger.Log(messageNext).Start(); }
private MessageModule LoadMessageModule() { var messageModule = new MessageModule(); int churchId = _session?.ChurchId ?? 3; // default to Graham var param = new GetCorrespondenceParameter(churchId, (int)MessageType.TextMessage, 100); // The Web Api GET method needs to be changed to remove the body from the message, and use query string instead //var correspondence = SubmitRequest<GetCorrespondenceParameter>("/api/message/GetCorrespondence", param); //var correspondence = await _apiProvider.GetItemAsync<GetCorrespondenceParameter>(Request, "/api/message/GetCorrespondence", mp); var correspondence = ""; var list = _apiProvider.DeserializeJson <List <Correspondence> >(correspondence); messageModule.CorrespondenceList = list.Select <Correspondence, CorrespondenceVm>(c => new CorrespondenceVm(c)).ToList(); var groups = SubmitRequest <int>("/api/message/GetGroups", churchId); var grps = _apiProvider.DeserializeJson <List <RecipientGroup> >(groups); messageModule.GroupList = grps.Select <RecipientGroup, GroupVm>(c => new GroupVm(c)).ToList(); //messageModule.MessageList int memberID = list.FirstOrDefault()?.ID ?? 0; // most received correspondence messageModule.MessageList = LoadMessageList(memberID); return(messageModule); }
/// <summary> /// C#-oriented-method: Write a log line to the logger. Exposes all parameters in a way that should make /// it very easy to use the logging behaviour from C#. /// </summary> /// <remarks> /// This method takes the **LogLevel** first, and then the message; to avoid having to grapple with /// overload resolution. The other Log(string, LogLine ...) method is in F# and won't add the same /// good defaults as this method. /// </remarks> /// <param name="logger"></param> /// <param name="level"></param> /// <param name="message">This is the message that you want to log. /// It's worth noting that a message without string.Format-ed parameters, is more equal /// across time, and if you have custom data you want to pass, you should rather set /// that data on the 'data' property of LogLine (with SetData and SetDatas).</param> /// <param name="setterTransformer"> /// There are extension methods in this library that go towards creating new instances /// of LogLine that you can use to change the value inside this function. /// </param> public static void Log( this Logger logger, LogLevel level, string message, Func <Message, Message> setterTransformer) { if (logger == null) { throw new ArgumentNullException("logger"); } if (level == null) { throw new ArgumentNullException("level"); } if (message == null) { throw new ArgumentNullException("message"); } if (setterTransformer == null) { throw new ArgumentNullException("setterTransformer"); } var line = MessageModule.CreateEvent(level, message); logger.log(setterTransformer(line)); }
private void Start() { Message = Framework.env1.modules.CreateModule <MessageModule>(); Listenner listenner = new Listenner(); Debug.Log(Framework.Version); Debug.Log(Message.Publish <Pub>(100, null)); }
private void Start() { Message = MessageModule.CreatInstance <MessageModule>("", ""); Listenner listenner = new Listenner(); Debug.Log(Framework.Version); Debug.Log(Message.Publish <Pub>(100, null)); }
public Skype4Sharp(Tokens tokens) { authTokens = tokens; mainCookies = new CookieContainer(); mainFactory = new HttpRequestFactory(); mainPoll = new Poller(this); selfProfile = new User(this); mainUserModule = new UserModule(this); mainAuthModule = new AuthModule(this); mainMessageModule = new MessageModule(this); mainContactModule = new ContactModule(this); }
public Skype4Sharp(SkypeCredentials loginData) { authInfo = loginData; mainCookies = new CookieContainer(); mainFactory = new HttpRequestFactory(); mainPoll = new Poller(this); selfProfile = new User(this); mainUserModule = new UserModule(this); mainAuthModule = new AuthModule(this); mainMessageModule = new MessageModule(this); mainContactModule = new ContactModule(this); }
public static async Task SampleUsage(Logger logger) { // without async logger.LogSimple(MessageModule.Event(LogLevel.Info, "User logged in")); // await placing the Hello World event in the buffer await logger.LogEvent(LogLevel.Debug, "Hello world. Important? {important}", new { important = "yes" }); // await logging the fatal event and getting an ack back from each of the configured // targets await logger.LogEvent(LogLevel.Fatal, "Fatal application error on finaliser thread.", waitForAck : true); await logger.LogEvent(LogLevel.Verbose, "We need to log this with backpressure.", new { tags = new[] { "tag1", "tag2" } }); // alternatively, you can use the ack-explicit functions together with the // data object model that's MessageModule. var message = MessageModule.Event(LogLevel.Warn, "Here be dragons!"); await logger.LogWithAck(message); var val = logger.Time(() => { for (int i = 0; i < 100; i++) { Thread.Sleep(1); } return(32); }, "sample.config.computeAnswerToEverything") (); await logger.LogEventFormat(LogLevel.Warn, "{horses} is the answer to the universe and everything", val); await logger.Time( () => logger.LogEvent(LogLevel.Debug, "I wonder how long this takes")) (); try { throw new ApplicationException("thing went haywire"); } catch (Exception e) { await logger.LogEventFormat(LogLevel.Fatal, "Unhandled {exception}!", e); } }
public Skype4Sharp(SkypeCredentials loginData, WebProxy loginProxy = null) { authInfo = loginData; mainProxy = loginProxy; mainFactory = new WebRequestFactory(mainProxy, new CookieContainer()); mainPoll = new Poller(this); selfProfile = new User(this); mainUserModule = new UserModule(this); mainAuthModule = new AuthModule(this); mainMessageModule = new MessageModule(this); mainContactModule = new ContactModule(this); }
/// <summary> /// Log an Event with the template string passed, in <see cref="string.Format(string,object)"/>-style. /// </summary> /// <param name="logger">The logger to invoke the Log call on</param> /// <param name="level">The level that the log format is at</param> /// <param name="formatStringMessage">Message to log, may contain C#-esque format placeholders.</param> /// <param name="args">Arguments to the format string</param> public static void LogEventFormat(this Logger logger, LogLevel level, string formatStringMessage, params object[] args) { if (logger == null) { throw new ArgumentNullException("logger"); } if (level == null) { throw new ArgumentNullException("level"); } if (formatStringMessage == null) { throw new ArgumentNullException("formatStringMessage"); } logger.Log(MessageModule.EventFormat(level, formatStringMessage, args)).Start(); }
/// <summary> /// Log a verbose log message /// </summary> /// <param name="logger">logger to invoke the Log call on</param> /// <param name="message">Message to pass to the targets</param> /// <param name="e">The exception that occurred</param> public static void VerboseException(this Logger logger, string message, Exception e) { if (logger == null) { throw new ArgumentNullException("logger"); } if (message == null) { throw new ArgumentNullException("message"); } if (e == null) { throw new ArgumentNullException("e"); } logger.log(MessageModule.CreateEvent(LogLevel.Verbose, message).AddException(e)); }
private bool TryCreateOption(out ShutdownOption option) { option = default; if (!TimeValue.HasValue) { return(false); } if (SelectActionUnit == null) { return(false); } if (SelectTimeUnit == null) { return(false); } var message = MessageModule.createNone(); if (Msg != null) { var result = MessageModule.createMsg(Msg); if (result.IsError) { return(false); } message = result.ResultValue; } var time = SelectTimeUnit.AsTimeSpan(TimeValue.Value); option = new ShutdownOption( SelectActionUnit.Action, TimeInSecond.NewTime(time), IsForceCloseWithoutSave ? CloseType.CloseWindowsWithoutSave : CloseType.SoftWindowsClose, message ); return(true); }
/// <summary> /// C#-oriented-method: Write an Event to the logger. Exposes all parameters in a way that should make /// it very easy to use the logging behaviour from C#. /// </summary> /// <param name="logger">Instance to invoke the extension method on</param> /// <param name="level"></param> /// <param name="template">A template message to attach to the event</param> /// <param name="fields">Data to attach to the log line being sent to the target; /// e.g. if using LogStash, these properties will be fields. For performance /// improvements, you can send a dictionary, or otherwise you can /// send an anonymous object whose public properties are then serialised /// as a dictionary. /// This is the message that you want to log. /// </param> /// <param name="timestamp"> /// When the Message was 'actual'. Optional, defaults to when this method is called. /// </param> /// <param name="exn"> /// Any exception associated with the event in this Message. Optional, defaults to null. /// </param> public static void LogEvent( this Logger logger, LogLevel level, string template, object fields = null, Instant?timestamp = null, Exception exn = null) { if (logger == null) { throw new ArgumentNullException("logger"); } if (level == null) { throw new ArgumentNullException("level"); } if (template == null) { throw new ArgumentNullException("template"); } var msg = MessageModule.Event(level, template); if (fields != null) { msg = msg.SetFieldsFromObject(fields); } if (timestamp != null) { msg = msg.SetTimestamp(timestamp.Value); } if (exn != null) { msg = msg.AddException(exn); } logger.Log(msg).Start(); }
/// <summary> /// C#-oriented-method: Write a log line to the logger. Exposes all parameters in a way that should make /// it very easy to use the logging behaviour from C#. /// </summary> /// <remarks> /// This method takes the **LogLevel** first, and then the message; to avoid having to grapple with /// overload resolution. The other Log(string, LogLine ...) method is in F# and won't add the same /// good defaults as this method. /// </remarks> /// <param name="logger">Instance to invoke the extension method on</param> /// <param name="level"></param> /// <param name="message">A message to attach to the log line</param> /// <param name="data">Data to attach to the log line being sent to the target; /// e.g. if using LogStash, these properties will be fields. For performance /// improvements, you can send a dictionary, or otherwise you can /// send an anonymous object whose public properties are then serialised /// as a dictionary. /// This is the message that you want to log. /// It's worth noting that a message without string.Format-ed parameters, is more equal /// across time, and if you have custom data you want to pass, you should rather set /// that data on the 'data' property of LogLine (with SetData and SetDatas). /// </param> /// <param name="service"></param> /// <param name="timestamp"> /// When the log entry was given; optional, defaults to when this method /// is called</param> public static void Log( this Logger logger, LogLevel level, string message, object data, string service = null, Instant?timestamp = null) { if (logger == null) { throw new ArgumentNullException("logger"); } if (level == null) { throw new ArgumentNullException("level"); } if (message == null) { throw new ArgumentNullException("message"); } var msg = MessageModule.CreateEvent(level, message); if (service != null) { msg.SetService(service); } if (data != null) { msg.AddData(data); } if (timestamp != null) { msg.SetTimestamp(timestamp.Value); } logger.log(msg); }
void Awake() { gameObject.AddComponent("PositionModule"); Position_Script = gameObject.GetComponent<PositionModule>(); gameObject.AddComponent("SystemModule");//添加脚本,姓名--刘旋,时间--2013-4-24 System_Script=gameObject.GetComponent<SystemModule>(); gameObject.AddComponent("MessageModule"); Message_Script=gameObject.GetComponent<MessageModule>(); gameObject.AddComponent("SoftkeyModule"); Softkey_Script = gameObject.GetComponent<SoftkeyModule>(); gameObject.AddComponent("ProgramModule"); Program_Script = gameObject.GetComponent<ProgramModule>(); gameObject.AddComponent("OffsetSettingModule"); Offset_Script = gameObject.GetComponent<OffsetSettingModule>(); gameObject.AddComponent("MDIInputModule"); MDIInput_Script = gameObject.GetComponent<MDIInputModule>(); gameObject.AddComponent("MDIFunctionModule"); MDIFunction_Script = gameObject.GetComponent<MDIFunctionModule>(); gameObject.AddComponent("MDIEditModule"); MDIEdit_Script = gameObject.GetComponent<MDIEditModule>(); gameObject.AddComponent("ModeSelectModule"); ModeSelect_Script = gameObject.GetComponent<ModeSelectModule>(); gameObject.AddComponent("FeedrateModule"); Feedrate_Script = gameObject.GetComponent<FeedrateModule>(); gameObject.AddComponent("MachineFunctionModule"); MachineFunction_Script = gameObject.GetComponent<MachineFunctionModule>(); gameObject.AddComponent("AuxiliaryFunctionModule"); AuxiliaryFunction_Script = gameObject.GetComponent<AuxiliaryFunctionModule>(); gameObject.AddComponent("AuxiliaryMoveModule"); AuxiliaryMove_Script = gameObject.GetComponent<AuxiliaryMoveModule>(); GameObject.Find("move_control").AddComponent("MoveControl"); MoveControl_script = GameObject.Find("move_control").GetComponent<MoveControl>(); GameObject.Find("spindle_control").AddComponent("SpindleControl"); SpindleControl_script = GameObject.Find("spindle_control").GetComponent<SpindleControl>(); gameObject.AddComponent("CooSystem"); gameObject.AddComponent("AutoMove"); gameObject.AddComponent("CompileNC"); CooSystem_script = gameObject.GetComponent<CooSystem>(); CompileNC_script = gameObject.GetComponent<CompileNC>(); t2d_lock = (Texture2D)Resources.Load("Texture_Panel/Button/lock"); t2d_unlock = (Texture2D)Resources.Load("Texture_Panel/Button/unlock"); t2d_alarm = (Texture2D)Resources.Load("Texture_Panel/Button/alarm"); t2d_zero = (Texture2D)Resources.Load("Texture_Panel/Button/zero"); t2d_toolnum = (Texture2D)Resources.Load("Texture_Panel/Button/toolnum"); t2d_em_u = (Texture2D)Resources.Load("Texture_Panel/Button/em_u"); t2d_em_d = (Texture2D)Resources.Load("Texture_Panel/Button/em_d"); t2d_Protect = t2d_lock; t2d_Emergency = t2d_em_u; t2d_ModeSelectEDIT = (Texture2D)Resources.Load("Texture_Panel/Button/mode_edit"); t2d_ModeSelectDNC = (Texture2D)Resources.Load("Texture_Panel/Button/mode_dnc"); t2d_ModeSelectAUTO = (Texture2D)Resources.Load("Texture_Panel/Button/mode_auto"); t2d_ModeSelectMDI = (Texture2D)Resources.Load("Texture_Panel/Button/mode_mdi"); t2d_ModeSelectHANDLE = (Texture2D)Resources.Load("Texture_Panel/Button/mode_handle"); t2d_ModeSelectJOG = (Texture2D)Resources.Load("Texture_Panel/Button/mode_jog"); t2d_ModeSelectREF = (Texture2D)Resources.Load("Texture_Panel/Button/mode_ref"); if(PlayerPrefs.HasKey("ModeSelect")) mode_type = PlayerPrefs.GetInt("ModeSelect"); else { PlayerPrefs.SetInt("ModeSelect", 1); mode_type = 1; } switch(mode_type) { case 1: t2d_ModeSelect = t2d_ModeSelectEDIT; MenuDisplay = "编辑"; ProgEDIT = true; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 2: t2d_ModeSelect = t2d_ModeSelectDNC; MenuDisplay = "DNC"; ProgEDIT = false; ProgDNC = true; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 3: t2d_ModeSelect = t2d_ModeSelectAUTO; MenuDisplay = "MEM"; ProgEDIT = false; ProgDNC = false; ProgAUTO = true; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 4: t2d_ModeSelect = t2d_ModeSelectMDI; MenuDisplay = "MDI"; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = true; ProgHAN = false; ProgJOG = false; ProgREF = false; break; case 5: t2d_ModeSelect = t2d_ModeSelectHANDLE; MenuDisplay = "HAN"; ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = true; ProgJOG = false; ProgREF = false; break; case 6: t2d_ModeSelect = t2d_ModeSelectJOG; MenuDisplay = "JOG"; MoveControl_script.speed_to_move = 0.16667F;//内容--JOG模式下,慢常速为10m/min=(10/60)m/s,因此spee-to-move=10/60,姓名--刘旋,时间--2013-4-8 ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = true; ProgREF = false; break; case 7: t2d_ModeSelect = t2d_ModeSelectREF; MenuDisplay = "REF"; MoveControl_script.speed_to_move = 0.6F;//内容--归零操作的实际速度为5m/min=(5/60)m/s,而实际速度RunningSpeed=speed—to-move*move-rate,因此speed-to-move应设为5/60,姓名--刘旋,时间--2013-4-8 ProgEDIT = false; ProgDNC = false; ProgAUTO = false; ProgMDI = false; ProgHAN = false; ProgJOG = false; ProgREF = true; break; } t2d_FeedRate_0 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate1"); t2d_FeedRate_10 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate2"); t2d_FeedRate_20 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate3"); t2d_FeedRate_30 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate4"); t2d_FeedRate_40 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate5"); t2d_FeedRate_50 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate6"); t2d_FeedRate_60 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate7"); t2d_FeedRate_70 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate8"); t2d_FeedRate_80 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate9"); t2d_FeedRate_90 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate10"); t2d_FeedRate_100 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate11"); t2d_FeedRate_110 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate12"); t2d_FeedRate_120 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate13"); t2d_FeedRate_130 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate14"); t2d_FeedRate_140 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate15"); t2d_FeedRate_150 = (Texture2D)Resources.Load("Texture_Panel/Button/feedrate16"); if(PlayerPrefs.HasKey("FeedrateSelect")) feedrate_type = PlayerPrefs.GetInt("FeedrateSelect"); else { PlayerPrefs.SetInt("FeedrateSelect", 11); feedrate_type = 11; } switch(feedrate_type) { case 1: t2d_feedrate = t2d_FeedRate_0; move_rate = 0f; break; case 2: t2d_feedrate = t2d_FeedRate_10; move_rate = 0.1f; break; case 3: t2d_feedrate = t2d_FeedRate_20; move_rate = 0.2f; break; case 4: t2d_feedrate = t2d_FeedRate_30; move_rate = 0.3f; break; case 5: t2d_feedrate = t2d_FeedRate_40; move_rate = 0.4f; break; case 6: t2d_feedrate = t2d_FeedRate_50; move_rate = 0.5f; break; case 7: t2d_feedrate = t2d_FeedRate_60; move_rate = 0.6f; break; case 8: t2d_feedrate = t2d_FeedRate_70; move_rate = 0.7f; break; case 9: t2d_feedrate = t2d_FeedRate_80; move_rate = 0.8f; break; case 10: t2d_feedrate = t2d_FeedRate_90; move_rate = 0.9f; break; case 11: t2d_feedrate = t2d_FeedRate_100; move_rate = 1.0f; break; case 12: t2d_feedrate = t2d_FeedRate_110; move_rate = 1.1f; break; case 13: t2d_feedrate = t2d_FeedRate_120; move_rate = 1.2f; break; case 14: t2d_feedrate = t2d_FeedRate_130; move_rate = 1.3f; break; case 15: t2d_feedrate = t2d_FeedRate_140; move_rate = 1.4f; break; case 16: t2d_feedrate = t2d_FeedRate_150; move_rate = 1.5f; break; } MoveControl_script.move_rate = move_rate; t2d_NCPower_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_on_u"); t2d_NCPower_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_on_d"); t2d_NCPower_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_off_u"); t2d_NCPower_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/NCPower_off_d"); sty_NCPowerOn.normal.background = t2d_NCPower_on_u; sty_NCPowerOn.active.background = t2d_NCPower_on_d; sty_NCPowerOff.normal.background = t2d_NCPower_off_u; sty_NCPowerOff.active.background = t2d_NCPower_off_d; t2d_spCW_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_off_d"); t2d_spCW_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_off_u"); t2d_spCW_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_on_d"); t2d_spCW_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCW_on_u"); sty_ButtonCW.normal.background = t2d_spCW_off_u; sty_ButtonCW.active.background = t2d_spCW_off_d; t2d_spCCW_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_on_u"); t2d_spCCW_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_on_d"); t2d_spCCW_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_off_u"); t2d_spCCW_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spCCW_off_d"); sty_ButtonCCW.normal.background = t2d_spCCW_off_u; sty_ButtonCCW.active.background = t2d_spCCW_off_d; t2d_spStop_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_on_u"); t2d_spStop_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_on_d"); t2d_spStop_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_off_u"); t2d_spStop_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/spStop_off_d"); sty_ButtonSTOP.normal.background = t2d_spStop_on_u; sty_ButtonSTOP.active.background = t2d_spStop_on_d; t2d_rapid_on_u = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_on_u"); t2d_rapid_on_d = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_on_d"); t2d_rapid_off_u = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_off_u"); t2d_rapid_off_d = (Texture2D)Resources.Load("Texture_Panel/Button/rapid_off_d"); sty_ButtonRapid.normal.background = t2d_rapid_off_u; sty_ButtonRapid.active.background = t2d_rapid_off_d; //内容--为变量赋值,用于实现JOG模式下F0,25%、50%、100%四个按钮的显示 //姓名--刘旋,时间--2013-4-8 t2d_f0_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f0_on_u"); t2d_f0_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f0_on_d"); t2d_f0_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f0_off_u"); t2d_f0_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f0_off_d"); sty_ButtonF0.normal.background=t2d_f0_off_u; sty_ButtonF0.active.background=t2d_f0_off_d; t2d_f25_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f25_on_u"); t2d_f25_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f25_on_d"); t2d_f25_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f25_off_u"); t2d_f25_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f25_off_d"); sty_ButtonF25.normal.background=t2d_f25_off_u; sty_ButtonF25.active.background=t2d_f25_off_d; t2d_f50_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f50_on_u"); t2d_f50_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f50_on_d"); t2d_f50_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f50_off_u"); t2d_f50_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f50_off_d"); sty_ButtonF50.normal.background=t2d_f50_off_u; sty_ButtonF50.active.background=t2d_f50_off_d; t2d_f100_on_u=(Texture2D)Resources.Load("Texture_Panel/Button/f100_on_u"); t2d_f100_on_d=(Texture2D)Resources.Load("Texture_Panel/Button/f100_on_d"); t2d_f100_off_u=(Texture2D)Resources.Load("Texture_Panel/Button/f100_off_u"); t2d_f100_off_d=(Texture2D)Resources.Load("Texture_Panel/Button/f100_off_d"); sty_ButtonF100.normal.background=t2d_f100_off_u; sty_ButtonF100.active.background=t2d_f100_off_d;//增加内容到此 2013-4-8 sty_ButtonYN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/yminus_off_u"); sty_ButtonYN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/yminus_on_d"); sty_ButtonYP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/yplus_off_u"); sty_ButtonYP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/yplus_on_d"); sty_ButtonZP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/zplus_off_u"); sty_ButtonZP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/zplus_on_d"); sty_ButtonZN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/zminus_off_u"); sty_ButtonZN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/zminus_on_d"); sty_ButtonXP.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/xplus_off_u"); sty_ButtonXP.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/xplus_on_d"); sty_ButtonXN.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/xminus_off_u"); sty_ButtonXN.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/xminus_on_d"); sty_Button4P.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/4plus_off_u"); sty_Button4P.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/4plus_on_d"); sty_Button4N.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/4minus_off_u"); sty_Button4N.active.background = (Texture2D)Resources.Load("Texture_Panel/Button/4minus_on_d"); sty_ProgEDITWindowO.font = (Font)Resources.Load("font/STSONG"); sty_ProgEDITWindowO.fontSize = 16; sty_ProgEDITWindowO.normal.textColor = Color.white; sty_Title.font = (Font)Resources.Load("font/digifaw"); sty_Title.fontSize = 15; sty_TitleLetter.font = (Font)Resources.Load("font/STSONG"); sty_TitleLetter.fontSize = 17; sty_BigXYZ.font = (Font)Resources.Load("font/LCD"); sty_BigXYZ.fontSize = 45; sty_SmallNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_SmallNum.fontSize = 14; sty_ProgModeName.font = (Font)Resources.Load("font/times"); sty_ProgModeName.fontSize = 14; sty_Star.fontSize = 22; sty_Alarm.font = (Font)Resources.Load("font/times"); sty_Alarm.fontSize = 12; sty_Alarm.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/red"); sty_Alarm.normal.textColor = Color.white; sty_BottomChooseMenu.font = (Font)Resources.Load("font/monoMMM_5"); //sty_BottomChooseMenu.font = (Font)Resources.Load("font/times"); sty_BottomChooseMenu.fontSize = 14; sty_ProgEditProgNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_ProgEditProgNum.fontSize = 15; sty_ProgEditProgNum.normal.textColor = Color.white; sty_PosSmallWord.font = (Font)Resources.Load("font/simfang"); sty_PosSmallWord.fontSize = 15; sty_SmallXYZ.font = (Font)Resources.Load("font/times"); sty_SmallXYZ.fontSize = 17; sty_ScreenCover.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/StartScreen"); sty_ProgEDITWindowFG.font = (Font)Resources.Load("font/simfang"); sty_ProgEDITWindowFG.fontSize = 15; sty_ProgEDITWindowFG.normal.textColor = Color.white; sty_BottomAST.font = (Font)Resources.Load("font/times"); sty_BottomAST.fontSize = 15; //sty_BottomAST.normal.textColor = Color.cyan; sty_MostWords.font = (Font)Resources.Load("font/simfang"); sty_MostWords.fontSize = 15; //sty_MostWords.normal.textColor = Color.cyan; //sty_Code.font = (Font)Resources.Load("font/dutch"); sty_Code.fontSize = 17; sty_Code.fontStyle = FontStyle.Bold; sty_ModeCode.fontSize=15; sty_ModeCode.fontStyle=FontStyle.Bold; //内容--sty-Mode赋值为蓝色 //姓名--刘旋,时间--2013-3-29 sty_Mode.fontSize=15; sty_Mode.fontStyle=FontStyle.Bold; sty_Mode.normal.textColor=Color.blue; sty_ProgEDITListWindowNum.font = (Font)Resources.Load("font/monoMMM_5"); sty_ProgEDITListWindowNum.fontSize = 13; sty_Cursor.font = (Font)Resources.Load("font/times"); sty_Cursor.fontSize = 15; sty_Warning.fontSize = 14; sty_Warning.normal.textColor = Color.red; sty_ScreenBackGround.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/ScreenBackground"); sty_TopLabel.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/toplabel"); sty_MessAlarm.font=(Font)Resources.Load("font/simfang"); sty_MessAlarm.normal.textColor=Color.red; sty_MessAlarm.fontSize=13; sty_MessRecordID.font=(Font)Resources.Load("font/simfang"); sty_MessRecordID.normal.textColor=Color.blue; sty_MessRecordID.fontSize=13; sty_MessRecordTime.font=(Font)Resources.Load("font/simfang"); sty_MessRecordTime.fontSize=14; sty_MessRecordInfo.font=(Font)Resources.Load("font/simfang"); sty_MessRecordInfo.fontSize=15; sty_SysID.font=(Font)Resources.Load("font/monoMMM_5"); sty_SysID.fontSize=13; sty_SysInfo.font=(Font)Resources.Load("font/simfang"); sty_SysInfo.fontSize=15; sty_SysInfo.normal.textColor=Color.blue; t2d_BottomButton_u = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); t2d_BottomButton_d = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_d"); sty_BottomButtonSmallest.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_smallest"); sty_BottomButton_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_d"); sty_BottomButton_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_4.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomButton_5.normal.background = (Texture2D)Resources.Load("Texture_Panel/Button/bottombutton_u"); sty_BottomLabel_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel01"); sty_BottomLabel_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel02"); sty_BottomLabel_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel03"); sty_BottomLabel_4.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/bottomLabel04"); sty_ClockStyle.fontSize = 14; sty_EDITLabel.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EDITLabel"); sty_EDITLabelWindow.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditWindow"); sty_EDITLabelBar_1.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar01"); sty_EDITLabelBar_2.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar02"); sty_EDITLabelBar_3.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditBar03"); sty_ProgSharedWindow.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/ProgSharedWindow"); sty_EDITCursor.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditCursor"); sty_EDITTextField.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditCursor"); sty_EDITTextField.normal.textColor = Color.yellow; sty_EDITTextField.fontSize = 17; sty_EDITTextField.fontStyle = FontStyle.Bold; sty_EDITList.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditList"); sty_InputTextField.font = (Font)Resources.Load("font/times"); sty_InputTextField.fontSize = 15; sty_OffSet_Coo.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo"); width = 670F; height = 650F; left = -700f; PanelWindowRect = new Rect(left, 30f, width, height); EDITText.enabled = false; EDITText.font = sty_Code.font; EDITText.fontSize = sty_Code.fontSize; //EDITText.fontStyle=FontStyle.Bold; EDITText.text = ""; ProgEDITCusorPos = 57f; CursorText.enabled = false; CursorText.font = sty_Cursor.font; CursorText.fontSize = sty_Cursor.fontSize; coo_setting_cursor_x = 131f; coo_setting_cursor_y = 120f; coo_setting_1 = 1; coo_setting_2 = 1; sty_SettingsBG.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/SettingsBG"); //设定界面修改---陈振华---03.11 sty_OffSet_Coo_mini.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo_mini"); sty_OffSet_Coo_mid.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/offset_coo_mid"); //设定界面修改---陈振华---03.11 sty_EditListTop.normal.background = (Texture2D)Resources.Load("Texture_Panel/Label/EditListTop"); OffSetTool = true; OffSetSetting = false; OffSetCoo = false; //刀偏界面完善---张振华---03.30 sty_MostWords_ToolOffSet.font = (Font)Resources.Load("font/simfang"); sty_MostWords_ToolOffSet.fontSize = 13; ToolOffSetPage_num = 0; //页面数 number = 0; //序号 tool_setting = 1; //黄色背景序号 tool_setting_cursor_y = 81.5f; tool_setting_cursor_w = 91.5f; //刀偏界面完善---张振华---03.30 }
/// <summary> /// Set the Message's timestamp /// </summary> public static Message SetTimestamp(this Message msg, Instant timestamp) { return(MessageModule.SetTicks(timestamp.Ticks, msg)); }
/// <summary> /// 被设置消息 /// </summary> /// <param name="message"></param> protected abstract void OnSetMessage(MessageModule message);
/// <summary> /// Add the key-value pairs to the data /// </summary> public static Message AddFields(this Message msg, IEnumerable <KeyValuePair <string, Field> > fields) { return(MessageModule.AddFields(fields.Select(kv => Tuple.Create(PointNameModule.FromString(kv.Key), kv.Value)), msg)); }
/// <summary> /// Serializes the object into fields and adds them to the message /// </summary> public static Message AddData(this Message msg, object obj) { return(MessageModule.AddData(obj, msg)); }
/// <summary> /// Add the key-value pairs to the data /// </summary> public static Message SetFieldsFromObject(this Message msg, IEnumerable <KeyValuePair <string, object> > fields) { return(MessageModule.SetFieldsFromSeq(fields.Select(kv => Tuple.Create(kv.Key, kv.Value)), msg)); }
/// <summary> /// Sets the level of the message /// </summary> public static Message SetLevel(this Message msg, LogLevel level) { return(MessageModule.SetLevel(level, msg)); }
/// <summary> /// Add the key-value pairs to the data /// </summary> public static Message SetFieldsFromObject(this Message msg, IEnumerable <KeyValuePair <string, Field> > fields) { return(MessageModule.SetFieldsFromObject(fields.Select(kv => Tuple.Create(PointNameModule.Parse(kv.Key), kv.Value)), msg)); }
/// <summary> /// Sets the format of the message /// </summary> public static Message SetMessage(this Message msg, string format) { return(MessageModule.SetEvent(format, msg)); }
/// <summary> /// Sets the context values from the Tuple[string, Value]. /// </summary> /// <returns>The context values.</returns> /// <param name="message">Message to add the contxt values to.</param> /// <param name="values">Values to add.</param> public static Message SetContextValues(this Message message, params Tuple <string, object>[] values) { return(MessageModule.SetContexts(values, message)); }
public void RegisterModule(MessageModule type) { type.ForRegistrations(this); }
/// <summary> /// Sets context values from the given object. The intention behind this method /// is that you give it an anonymous object and that that object forms has the properties /// whose names you want as keys. /// </summary> /// <returns>The context object.</returns> /// <param name="message">Message to base the new message off of.</param> /// <param name="o">Object with properties and data.</param> public static Message SetContextFromObject(this Message message, object o) { return(MessageModule.SetContextFromObject(o, message)); }
/// <summary> /// Set the Message's timestamp. /// </summary> public static Message SetTimestamp(this Message msg, NodaTime.Instant timestamp) { return(MessageModule.SetTicksEpoch(timestamp.ToUnixTimeTicks(), msg)); }
/// <summary> /// Sets the message name/path. /// </summary> public static Message SetName(this Message message, string name) { return(MessageModule.SetName(name, message)); }
/// <summary> /// 设置好message模块时 /// </summary> /// <param name="message"></param> protected override void OnSetMessage(MessageModule message) { }
/// <summary> /// Set the Message's main exception property /// </summary> public static Message AddException(this Message msg, Exception ex) { return(MessageModule.AddException(ex, msg)); }
/// <summary> /// Serializes the object into fields and adds them to the message /// </summary> public static Message SetFieldsFromObject(this Message msg, object obj) { return(MessageModule.SetFieldsFromObject(obj, msg)); }
/// <summary> /// Appends the nameEnding to the existing message name. If you've logged the /// message from a logger, the existing name is likely the name of your logger. /// </summary> public static Message SetNameEnding(this Message message, string nameEnding) { return(MessageModule.SetNameEnding(nameEnding, message)); }